exercism / awk

Exercism exercises in AWK.
https://exercism.org/tracks/awk
MIT License
18 stars 21 forks source link

Issue with one of the unit tests for AWK "all your base" #204

Closed TheLinuxEnthusiast closed 1 year ago

TheLinuxEnthusiast commented 1 year ago

Hi,

One of the unit tests has the obase parameter in the wrong location:

@test 'output base is one' { [[ $BATS_RUN_SKIPPED == "true" ]] || skip run gawk -f all-your-base.awk -v ibase=2 1 <<< "1 0 1 0 1 -v obase=0" assert_failure assert_output # there is some output }

It should be changed to the following:

@test 'output base is one' { [[ $BATS_RUN_SKIPPED == "true" ]] || skip run gawk -f all-your-base.awk -v ibase=2 obase=1 <<< "1 0 1 0 1" assert_failure assert_output # there is some output }

Otherwise the test won't run.

Darren Foley

glennj commented 1 year ago

Thanks for pointing this out.

Pedantically, it does run and it (should) output the right error message:

$ gawk -f all-your-base.awk -v ibase=2 1 <<< "1 0 1 0 1 -v obase=0"
:0: assertion failed: Output base must be greater than one

1 is a valid awk program. It is, I think, executing the -f code first before running the "1" code.