@@ -209,6 +209,30 @@ def test_color(self):
209209 '\x1b [35mnear "sel": syntax error\x1b [0m' , err )
210210
211211
212+ class Completer (unittest .TestCase ):
213+
214+ def test_schema_name_with_double_quote (self ):
215+ from sqlite3 ._completer import _complete
216+
217+ con = sqlite3 .connect (":memory:" )
218+ self .addCleanup (con .close )
219+ con .execute ("ATTACH ? AS ?" , (":memory:" , 'double"quote' ))
220+ con .execute ('CREATE TABLE [double"quote].table_match(value)' )
221+ self .assertEqual (_complete (con , "table_" , 0 ), "table_match " )
222+
223+ @unittest .skipIf (sqlite3 .sqlite_version_info < (3 , 16 , 0 ),
224+ "PRAGMA table-valued function is not available until "
225+ "SQLite 3.16.0" )
226+ def test_schema_name_with_single_quote (self ):
227+ from sqlite3 ._completer import _complete
228+
229+ con = sqlite3 .connect (":memory:" )
230+ self .addCleanup (con .close )
231+ con .execute ("ATTACH ? AS ?" , (":memory:" , "single'quote" ))
232+ con .execute ("CREATE TABLE [single'quote].other(column_match)" )
233+ self .assertEqual (_complete (con , "column_" , 0 ), "column_match " )
234+
235+
212236@requires_subprocess ()
213237@force_not_colorized_test_class
214238class Completion (unittest .TestCase ):
0 commit comments