File tree Expand file tree Collapse file tree 1 file changed +41
-1
lines changed Expand file tree Collapse file tree 1 file changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -572,6 +572,46 @@ def test_auto_indent_with_comment(self):
572
572
output = multiline_input (reader )
573
573
self .assertEqual (output , output_code )
574
574
575
+ # fmt: off
576
+ events = code_to_events (
577
+ "def f():\n "
578
+ "# foo\n "
579
+ "pass\n \n "
580
+ )
581
+
582
+ output_code = (
583
+ "def f():\n "
584
+ " # foo\n "
585
+ " pass\n "
586
+ " "
587
+ )
588
+ # fmt: on
589
+
590
+ reader = self .prepare_reader (events )
591
+ output = multiline_input (reader )
592
+ self .assertEqual (output , output_code )
593
+
594
+ # fmt: off
595
+ events = itertools .chain (
596
+ code_to_events ("def f():\n " ),
597
+ [
598
+ Event (evt = "key" , data = "backspace" , raw = b"\x08 " ),
599
+ ],
600
+ code_to_events ("# foo\n pass\n \n " )
601
+ )
602
+
603
+ output_code = (
604
+ "def f():\n "
605
+ "# foo\n "
606
+ " pass\n "
607
+ " "
608
+ )
609
+ # fmt: on
610
+
611
+ reader = self .prepare_reader (events )
612
+ output = multiline_input (reader )
613
+ self .assertEqual (output , output_code )
614
+
575
615
def test_auto_indent_with_multicomment (self ):
576
616
# fmt: off
577
617
events = code_to_events (
@@ -605,7 +645,7 @@ def test_auto_indent_ignore_comments(self):
605
645
output = multiline_input (reader )
606
646
self .assertEqual (output , output_code )
607
647
608
- def test_auto_indent_noncomment_hash (self ):
648
+ def test_auto_indent_hashtag (self ):
609
649
# fmt: off
610
650
events = code_to_events (
611
651
"if ' ' == '#':\n "
You can’t perform that action at this time.
0 commit comments