@@ -39,9 +39,12 @@ def test_codecomplete(self) -> None:
3939
4040 # Continuation
4141 code_continuation_incomplete = ' int foo = 12; \\ \n float bar = 1.5f;\\ '
42- code_continuation_complete = ' int foo = 12; \\ \n float bar = 1.5f;'
43-
44- code_incomplete = ['void foo(int c) \\ \n { \\ \n ' , 'void foo(\\ \n ' , '#ifdef\\ \n ' ]
42+ code_continuation_complete = [' int foo = 12; \\ \n float bar = 1.5f;' ,
43+ ' // This is a comment\\ \n ' ]
44+
45+ code_incomplete = ['void foo(int c) \\ \n { \\ \n ' , 'void foo(\\ \n ' , '#ifdef\\ \n ' ,
46+ 'int res = my_array[\\ \n ' , '/* coincoin\\ \n ' ,
47+ 'func("ab", \\ \n ' ]
4548
4649 def test_continuation (self ) -> None :
4750 if not self .code_continuation_incomplete or not self .code_continuation_complete :
@@ -57,13 +60,14 @@ def test_continuation(self) -> None:
5760 self .assertEqual (reply ["content" ]["status" ], "incomplete" )
5861
5962 # Complete
60- self .flush_channels ()
61- msg_id = self .kc .is_complete (self .code_continuation_complete )
62- reply = self .get_non_kernel_info_reply (timeout = 1 )
63- assert reply is not None
64- self .assertEqual (reply ["msg_type" ], "is_complete_reply" )
65- self .assertEqual (str (reply ["content" ]["indent" ]), " " )
66- self .assertEqual (reply ["content" ]["status" ], "complete" )
63+ for c in self .code_continuation_complete :
64+ self .flush_channels ()
65+ msg_id = self .kc .is_complete (c )
66+ reply = self .get_non_kernel_info_reply (timeout = 1 )
67+ assert reply is not None
68+ self .assertEqual (reply ["msg_type" ], "is_complete_reply" )
69+ self .assertEqual (str (reply ["content" ]["indent" ]), " " )
70+ self .assertEqual (reply ["content" ]["status" ], "complete" )
6771
6872 # Code incomplete
6973 for c in self .code_incomplete :
0 commit comments