@@ -125,6 +125,27 @@ def test_interact_version(self):
125125 self .assertEqual (out .count (self .PS2 ), 0 )
126126 self .assertIn (sqlite3 .sqlite_version , out )
127127
128+ def test_interact_tables (self ):
129+ out , err = self .run_cli (commands = (
130+ "CREATE TABLE table_ (id INTEGER);" ,
131+ "CREATE TEMP TABLE temp_table (id INTEGER);" ,
132+ "CREATE VIEW view_ AS SELECT * FROM table_;" ,
133+ "CREATE TEMP VIEW temp_view As SELECT * FROM table_;" ,
134+ "ATTACH ':memory:' AS attach_;" ,
135+ "CREATE TABLE attach_.table_ (id INTEGER);" ,
136+ "CREATE VIEW attach_.view_ AS SELECT * FROM table_;" ,
137+ "ATTACH ':memory:' AS 123;" ,
138+ "CREATE TABLE \" 123\" .table_ (id INTEGER);" ,
139+ "CREATE VIEW \" 123\" .view_ AS SELECT * FROM table_;" ,
140+ ".tables" ,
141+ ))
142+ self .assertIn (self .MEMORY_DB_MSG , err )
143+ self .assertEndsWith (out , self .PS1 )
144+ self .assertEqual (out .count (self .PS1 ), 12 )
145+ self .assertEqual (out .count (self .PS2 ), 0 )
146+ self .assertIn ("123.table_\n 123.view_\n attach_.table_\n attach_.view_\n "
147+ "table_\n temp.temp_table\n temp.temp_view\n view_\n " , out )
148+
128149 def test_interact_empty_source (self ):
129150 out , err = self .run_cli (commands = ("" , " " ))
130151 self .assertIn (self .MEMORY_DB_MSG , err )
0 commit comments