Skip to content

Commit

Permalink
Insufficient validation in @define #85
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Dec 22, 2021
1 parent 6286fac commit fa56773
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tests/16_define_validation.tush
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/16_define_validation_error.sh
@ Invalid define declaration:
@ tests/16_define_validation_error.sh:18: @define C='aaa aaa' echo 'Hello' # comment
@ Invalid define declaration:
@ tests/16_define_validation_error.sh:19: @define C='aaa aaa' echo 'Hello' ; # comment
@ tests/16_define_validation_error.sh:19: @define C1='aaa aaa' echo 'Hello' ; # comment
@ Invalid define declaration:
@ tests/16_define_validation_error.sh:22: @define B3='bbb ; bbb';
@ Invalid define declaration:
Expand All @@ -78,6 +78,8 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/16_define_validation_error.sh
@ Invalid define declaration:
@ tests/16_define_validation_error.sh:32: @define IL5=a-b
@ Invalid define declaration:
@ tests/16_define_validation_error.sh:33: @define IL5=a+b
@ tests/16_define_validation_error.sh:33: @define IL6=a+b
@ Invalid define declaration:
@ tests/16_define_validation_error.sh:34: @define IL7=a;;;b
? 1

5 changes: 3 additions & 2 deletions tests/16_define_validation_error.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@define A=aaa echo 'Hello' # comment
@define B=aaa\ aaa echo 'Hello'# comment
@define C='aaa aaa' echo 'Hello' # comment
@define C='aaa aaa' echo 'Hello' ; # comment
@define C1='aaa aaa' echo 'Hello' ; # comment

# Let's disallow ';' for simplicity and unification
@define B3='bbb ; bbb';
Expand All @@ -30,7 +30,8 @@
@define IL3=a&&b
@define IL4=a!b
@define IL5=a-b
@define IL5=a+b
@define IL6=a+b
@define IL7=a;;;b

@goal default
echo 'Should not show'
Expand Down

0 comments on commit fa56773

Please sign in to comment.