@@ -129,9 +129,9 @@ def test_interact_tables(self):
129129 out , err = self .run_cli (commands = (
130130 "CREATE TABLE table_ (id INTEGER);" ,
131131 "CREATE TABLE sqlitee (id INTEGER);" ,
132- "CREATE TEMP TABLE temp_table (id INTEGER);" ,
132+ "CREATE TEMP TABLE table_ (id INTEGER);" ,
133133 "CREATE VIEW view_ AS SELECT 1;" ,
134- "CREATE TEMP VIEW temp_view AS SELECT 1;" ,
134+ "CREATE TEMP VIEW view_ AS SELECT 1;" ,
135135 "ATTACH ':memory:' AS attach_;" ,
136136 "CREATE TABLE attach_.table_ (id INTEGER);" ,
137137 "CREATE VIEW attach_.view_ AS SELECT 1;" ,
@@ -150,10 +150,34 @@ def test_interact_tables(self):
150150 "attach_.view_" ,
151151 "sqlitee" ,
152152 "table_" ,
153- "temp.temp_table " ,
154- "temp.temp_view " ,
153+ "temp.table_ " ,
154+ "temp.view_ " ,
155155 "view_" )
156- self .assertIn ("\n " .join (tables ), out )
156+ self .assertEqual ("\n " .join (tables ), out .replace (self .PS1 , "" ).strip ())
157+
158+ def test_interact_indexes (self ):
159+ out , err = self .run_cli (commands = (
160+ "CREATE TABLE table_ (id INTEGER);" ,
161+ "CREATE INDEX idx_table_ ON table_ (id);" ,
162+ "CREATE TEMP TABLE temp_table (id INTEGER);" ,
163+ "CREATE INDEX temp.idx_temp_table_ ON temp_table (id);" ,
164+ "ATTACH ':memory:' AS attach_;" ,
165+ "CREATE TABLE attach_.attach_table (id INTEGER);" ,
166+ "CREATE INDEX attach_.idx_attach_table ON attach_table (id);" ,
167+ ".indexes" ,
168+ ".indices" ,
169+ ))
170+ self .assertIn (self .MEMORY_DB_MSG , err )
171+ self .assertEndsWith (out , self .PS1 )
172+ self .assertEqual (out .count (self .PS1 ), 10 )
173+ self .assertEqual (out .count (self .PS2 ), 0 )
174+ expected = ("attach_.idx_attach_table" ,
175+ "idx_table_" ,
176+ "temp.idx_temp_table_" ,
177+ "attach_.idx_attach_table" ,
178+ "idx_table_" ,
179+ "temp.idx_temp_table_" )
180+ self .assertEqual ("\n " .join (expected ), out .replace (self .PS1 , "" ).strip ())
157181
158182 def test_interact_empty_source (self ):
159183 out , err = self .run_cli (commands = ("" , " " ))
0 commit comments