Closed fgm closed 2 years ago
@IsaacG you had the same kind of question about this test earlier. Do you want to chime in?
A brain cramp: the instructions.md file is shared between tracks, so it should not be modified.
Any AWK specific instructions need to be added to instructions.append.md
If we don't want students to have to figure out the specific behavior, it might make more sense just to drop that test.
If we do want to bother having this input handled, we do take a TDD approach for most other exercises.
Or, the test can have a line of output for each line of input.
@test "multiple names given" {
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
run gawk -f two-fer.awk two.txt
assert_success
assert_line --index 0 -- "One for John Smith, one for me."
assert_line --index 1 -- "One for Mary Ann, one for me."
}
That would be less surprising.
Even with multiple files
@test "multiple names given" {
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
run gawk -f two-fer.awk one.txt two.txt
assert_success
assert_line --index 0 -- "One for Alice, one for me."
assert_line --index 1 -- "One for John Smith, one for me."
assert_line --index 2 -- "One for Mary Ann, one for me."
}
@fgm would you like to change the approach to this PR and edit the test file?
@IsaacG should we remove the multiple-input test, or have the test expect a line of output for each line of input?
I'm in favor of just dropping it.
The test sends multiple lines, but unlike what would be expected from the current description, it only expects the last one to be used. Added a line to explain that.