File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -605,6 +605,43 @@ def test_auto_indent_ignore_comments(self):
605605 output = multiline_input (reader )
606606 self .assertEqual (output , output_code )
607607
608+ def test_auto_indent_noncomment_hash (self ):
609+ # fmt: off
610+ events = code_to_events (
611+ "if ' ' == '#':\n "
612+ "pass\n \n "
613+ )
614+
615+ output_code = (
616+ "if ' ' == '#':\n "
617+ " pass\n "
618+ " "
619+ )
620+ # fmt: on
621+
622+ reader = self .prepare_reader (events )
623+ output = multiline_input (reader )
624+ self .assertEqual (output , output_code )
625+
626+ def test_auto_indent_multiline_string (self ):
627+ # fmt: off
628+ events = code_to_events (
629+ "s = '''\n "
630+ "Note:\n "
631+ "'''\n \n "
632+ )
633+
634+ output_code = (
635+ "s = '''\n "
636+ "Note:\n "
637+ "'''"
638+ )
639+ # fmt: on
640+
641+ reader = self .prepare_reader (events )
642+ output = multiline_input (reader )
643+ self .assertEqual (output , output_code )
644+
608645
609646class TestPyReplOutput (ScreenEqualMixin , TestCase ):
610647 def prepare_reader (self , events ):
You can’t perform that action at this time.
0 commit comments