@@ -46,7 +46,7 @@ def test_parse_empty_string(parser) -> None:
4646 assert statement .raw == line
4747 assert statement .command == ''
4848 assert statement .arg_list == []
49- assert statement .multiline_command == ''
49+ assert not statement .multiline_command
5050 assert statement .terminator == ''
5151 assert statement .suffix == ''
5252 assert statement .pipe_to == ''
@@ -64,7 +64,7 @@ def test_parse_empty_string_default(default_parser) -> None:
6464 assert statement .raw == line
6565 assert statement .command == ''
6666 assert statement .arg_list == []
67- assert statement .multiline_command == ''
67+ assert not statement .multiline_command
6868 assert statement .terminator == ''
6969 assert statement .suffix == ''
7070 assert statement .pipe_to == ''
@@ -144,7 +144,7 @@ def test_parse_single_word(parser, line) -> None:
144144 assert not statement .arg_list
145145 assert statement .args == statement
146146 assert statement .raw == line
147- assert statement .multiline_command == ''
147+ assert not statement .multiline_command
148148 assert statement .terminator == ''
149149 assert statement .suffix == ''
150150 assert statement .pipe_to == ''
@@ -527,7 +527,7 @@ def test_parse_redirect_inside_terminator(parser) -> None:
527527)
528528def test_parse_multiple_terminators (parser , line , terminator ) -> None :
529529 statement = parser .parse (line )
530- assert statement .multiline_command == 'multiline'
530+ assert statement .multiline_command
531531 assert statement == 'with | inside'
532532 assert statement .args == statement
533533 assert statement .argv == ['multiline' , 'with' , '|' , 'inside' ]
@@ -538,7 +538,7 @@ def test_parse_multiple_terminators(parser, line, terminator) -> None:
538538def test_parse_unfinished_multiliine_command (parser ) -> None :
539539 line = 'multiline has > inside an unfinished command'
540540 statement = parser .parse (line )
541- assert statement .multiline_command == 'multiline'
541+ assert statement .multiline_command
542542 assert statement .command == 'multiline'
543543 assert statement == 'has > inside an unfinished command'
544544 assert statement .args == statement
@@ -550,7 +550,7 @@ def test_parse_unfinished_multiliine_command(parser) -> None:
550550def test_parse_basic_multiline_command (parser ) -> None :
551551 line = 'multiline foo\n bar\n \n '
552552 statement = parser .parse (line )
553- assert statement .multiline_command == 'multiline'
553+ assert statement .multiline_command
554554 assert statement .command == 'multiline'
555555 assert statement == 'foo bar'
556556 assert statement .args == statement
@@ -572,7 +572,7 @@ def test_parse_basic_multiline_command(parser) -> None:
572572)
573573def test_parse_multiline_command_ignores_redirectors_within_it (parser , line , terminator ) -> None :
574574 statement = parser .parse (line )
575- assert statement .multiline_command == 'multiline'
575+ assert statement .multiline_command
576576 assert statement == 'has > inside'
577577 assert statement .args == statement
578578 assert statement .argv == ['multiline' , 'has' , '>' , 'inside' ]
@@ -583,7 +583,7 @@ def test_parse_multiline_command_ignores_redirectors_within_it(parser, line, ter
583583def test_parse_multiline_terminated_by_empty_line (parser ) -> None :
584584 line = 'multiline command ends\n \n '
585585 statement = parser .parse (line )
586- assert statement .multiline_command == 'multiline'
586+ assert statement .multiline_command
587587 assert statement .command == 'multiline'
588588 assert statement == 'command ends'
589589 assert statement .args == statement
@@ -605,7 +605,7 @@ def test_parse_multiline_terminated_by_empty_line(parser) -> None:
605605)
606606def test_parse_multiline_with_embedded_newline (parser , line , terminator ) -> None :
607607 statement = parser .parse (line )
608- assert statement .multiline_command == 'multiline'
608+ assert statement .multiline_command
609609 assert statement .command == 'multiline'
610610 assert statement == 'command "with\n embedded newline"'
611611 assert statement .args == statement
@@ -617,7 +617,7 @@ def test_parse_multiline_with_embedded_newline(parser, line, terminator) -> None
617617def test_parse_multiline_ignores_terminators_in_quotes (parser ) -> None :
618618 line = 'multiline command "with term; ends" now\n \n '
619619 statement = parser .parse (line )
620- assert statement .multiline_command == 'multiline'
620+ assert statement .multiline_command
621621 assert statement .command == 'multiline'
622622 assert statement == 'command "with term; ends" now'
623623 assert statement .args == statement
@@ -694,7 +694,7 @@ def test_parse_alias_and_shortcut_expansion(parser, line, command, args) -> None
694694def test_parse_alias_on_multiline_command (parser ) -> None :
695695 line = 'anothermultiline has > inside an unfinished command'
696696 statement = parser .parse (line )
697- assert statement .multiline_command == 'multiline'
697+ assert statement .multiline_command
698698 assert statement .command == 'multiline'
699699 assert statement .args == statement
700700 assert statement == 'has > inside an unfinished command'
@@ -761,7 +761,7 @@ def test_parse_command_only_command_and_args(parser) -> None:
761761 assert statement .arg_list == []
762762 assert statement .command == 'help'
763763 assert statement .command_and_args == line
764- assert statement .multiline_command == ''
764+ assert not statement .multiline_command
765765 assert statement .raw == line
766766 assert statement .terminator == ''
767767 assert statement .suffix == ''
@@ -778,7 +778,7 @@ def test_parse_command_only_strips_line(parser) -> None:
778778 assert statement .arg_list == []
779779 assert statement .command == 'help'
780780 assert statement .command_and_args == line .strip ()
781- assert statement .multiline_command == ''
781+ assert not statement .multiline_command
782782 assert statement .raw == line
783783 assert statement .terminator == ''
784784 assert statement .suffix == ''
@@ -795,7 +795,7 @@ def test_parse_command_only_expands_alias(parser) -> None:
795795 assert statement .arg_list == []
796796 assert statement .command == 'run_pyscript'
797797 assert statement .command_and_args == 'run_pyscript foobar.py "somebody.py'
798- assert statement .multiline_command == ''
798+ assert not statement .multiline_command
799799 assert statement .raw == line
800800 assert statement .terminator == ''
801801 assert statement .suffix == ''
@@ -812,9 +812,8 @@ def test_parse_command_only_expands_shortcuts(parser) -> None:
812812 assert statement .arg_list == []
813813 assert statement .command == 'shell'
814814 assert statement .command_and_args == 'shell cat foobar.txt'
815- assert statement .multiline_command == ''
815+ assert not statement .multiline_command
816816 assert statement .raw == line
817- assert statement .multiline_command == ''
818817 assert statement .terminator == ''
819818 assert statement .suffix == ''
820819 assert statement .pipe_to == ''
@@ -830,9 +829,8 @@ def test_parse_command_only_quoted_args(parser) -> None:
830829 assert statement .arg_list == []
831830 assert statement .command == 'shell'
832831 assert statement .command_and_args == line .replace ('l' , 'shell ls -al' )
833- assert statement .multiline_command == ''
832+ assert not statement .multiline_command
834833 assert statement .raw == line
835- assert statement .multiline_command == ''
836834 assert statement .terminator == ''
837835 assert statement .suffix == ''
838836 assert statement .pipe_to == ''
@@ -849,9 +847,8 @@ def test_parse_command_only_unclosed_quote(parser) -> None:
849847 assert statement .arg_list == []
850848 assert statement .command == 'command'
851849 assert statement .command_and_args == line
852- assert statement .multiline_command == ''
850+ assert not statement .multiline_command
853851 assert statement .raw == line
854- assert statement .multiline_command == ''
855852 assert statement .terminator == ''
856853 assert statement .suffix == ''
857854 assert statement .pipe_to == ''
@@ -877,9 +874,8 @@ def test_parse_command_only_specialchars(parser, line, args) -> None:
877874 assert statement == args
878875 assert statement .args == args
879876 assert statement .command == 'help'
880- assert statement .multiline_command == ''
877+ assert not statement .multiline_command
881878 assert statement .raw == line
882- assert statement .multiline_command == ''
883879 assert statement .terminator == ''
884880 assert statement .suffix == ''
885881 assert statement .pipe_to == ''
@@ -910,9 +906,8 @@ def test_parse_command_only_empty(parser, line) -> None:
910906 assert statement .arg_list == []
911907 assert statement .command == ''
912908 assert statement .command_and_args == ''
913- assert statement .multiline_command == ''
909+ assert not statement .multiline_command
914910 assert statement .raw == line
915- assert statement .multiline_command == ''
916911 assert statement .terminator == ''
917912 assert statement .suffix == ''
918913 assert statement .pipe_to == ''
@@ -924,7 +919,7 @@ def test_parse_command_only_multiline(parser) -> None:
924919 line = 'multiline with partially "open quotes and no terminator'
925920 statement = parser .parse_command_only (line )
926921 assert statement .command == 'multiline'
927- assert statement .multiline_command == 'multiline'
922+ assert statement .multiline_command
928923 assert statement == 'with partially "open quotes and no terminator'
929924 assert statement .command_and_args == line
930925 assert statement .args == statement
@@ -941,7 +936,7 @@ def test_statement_initialization() -> None:
941936 assert not statement .arg_list
942937 assert isinstance (statement .argv , list )
943938 assert not statement .argv
944- assert statement .multiline_command == ''
939+ assert not statement .multiline_command
945940 assert statement .terminator == ''
946941 assert statement .suffix == ''
947942 assert isinstance (statement .pipe_to , str )
0 commit comments