Skip to content

Commit

Permalink
Merge branch 'main' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Mar 10, 2024
2 parents 07057e8 + ca2bf5f commit cfcf05b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ jobs:
- name: "run tests"
run: |
# TODO understand if this step can be cached
brew install gawk
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 \
brew install gawk
PATH="/usr/local/opt/gawk/libexec/gnubin:$PATH" \
./makesure
Expand Down
2 changes: 1 addition & 1 deletion makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ function parseCli_2(line, vars, vars2, res, pos,c,c1,isDoll,q,var,inDef,defVal
while ((c = substr(line, ++pos, 1)) != "" && c != " " && c != "\t") { # whitespace denotes the end of arg
w = w c
}
if (w !~ /^[_A-Za-z0-9@.]+$/)
if (w !~ /^[-_A-Za-z0-9@.]+$/)
return "wrong unquoted: '" w "'"
res[i = +res[-7]++, "quote"] = "u"
res[i] = w
Expand Down
5 changes: 2 additions & 3 deletions tests/16_define_validation.tush
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ $ ./$MAKESURE -f tests/16_define_validation_pass.sh
| EC1=eee
| KC1=aaabbbcc'ca b ceee
| LC1=aaabbb bbbcc'c cc'ca b ceee eee
| IL5=a-b

$ ./$MAKESURE -f tests/16_define_validation_error.sh
@ Invalid @define syntax, should be @define VAR_NAME 'value':
Expand Down Expand Up @@ -81,8 +82,6 @@ $ ./$MAKESURE -f tests/16_define_validation_error.sh
@ tests/16_define_validation_error.sh:30: @define IL3 a&&b
@ Syntax error: wrong unquoted: 'a!b':
@ tests/16_define_validation_error.sh:31: @define IL4 a!b
@ Syntax error: wrong unquoted: 'a-b':
@ tests/16_define_validation_error.sh:32: @define IL5 a-b
@ Syntax error: wrong unquoted: 'a+b':
@ tests/16_define_validation_error.sh:33: @define IL6 a+b
@ Syntax error: wrong unquoted: 'a;;;b':
Expand All @@ -91,7 +90,7 @@ $ ./$MAKESURE -f tests/16_define_validation_error.sh
@ tests/16_define_validation_error.sh:36: @define 0wrong_name 123
@ Syntax error: wrong unquoted: 'wrong,name':
@ tests/16_define_validation_error.sh:37: @define wrong,name 123
@ Syntax error: wrong unquoted: 'wrong-name':
@ Wrong variable name: 'wrong-name':
@ tests/16_define_validation_error.sh:38: @define wrong-name 123
? 1

2 changes: 1 addition & 1 deletion tests/16_define_validation_error.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@define IL2 a&b
@define IL3 a&&b
@define IL4 a!b
@define IL5 a-b

@define IL6 a+b
@define IL7 a;;;b

Expand Down
5 changes: 3 additions & 2 deletions tests/16_define_validation_pass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
@define KC1 $'aaabbbcc\'ca b ceee' # some comment
@define LC1 "$A$B$C$D$E" # other comment

@define IL5 a-b

@goal default
for x in EMPTY EMPTY1 EMPTY2 EMPTY3 _a123 good__NaMe_ A B B1 B2 C C1 D D1 D2 E F K L AC1 AC2 BC1 BC2 CC1 DC1 EC1 KC1 LC1
# for x in EMPTY1 EMPTY2 EMPTY3 _a123 good__NaMe_ A B B1 B2 C C1 D D1 D2 E F K L AC1 AC2 BC1 BC2 CC1 DC1 EC1 KC1 LC1
for x in EMPTY EMPTY1 EMPTY2 EMPTY3 _a123 good__NaMe_ A B B1 B2 C C1 D D1 D2 E F K L AC1 AC2 BC1 BC2 CC1 DC1 EC1 KC1 LC1 IL5
do
printf '%-3s=%s\n' "$x" "${!x}"
done
Expand Down
2 changes: 1 addition & 1 deletion tests/1_goals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
echo >&2 stderr
exit 123


@goal good-name # should not cause error
5 changes: 3 additions & 2 deletions tests/1_goals.tush
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ $ ./$MAKESURE -f tests/1_goals.sh --silent
$ ./$MAKESURE -f tests/1_goals.sh -l
| Available goals:
| default
| aaa : Documenatation for aaa
| bbb : Documenatation for bbb
| aaa : Documenatation for aaa
| bbb : Documenatation for bbb
| ccc
| ddd
| fail
| fail123
| good-name

$ ./$MAKESURE -f tests/1_goals.sh -d
| Resolved goals to reach for 'default':
Expand Down

0 comments on commit cfcf05b

Please sign in to comment.