I’m having some cognitive dissonance with writing the exercises because the student will write them one way but they will be executed another way with the test tool. The test tool reads the script, removes the trailing END, and then compiles it using CODE().
So the student writes a “raindrops” solution as
RAINDROPS INPUT.NUMBER = INPUT
RESULT = EQ(REMDR(INPUT.NUMBER,3),0) RESULT "Pling"
RESULT = EQ(REMDR(INPUT.NUMBER,5),0) RESULT "Plang"
RESULT = EQ(REMDR(INPUT.NUMBER,7),0) RESULT "Plong"
RESULT = IDENT(RESULT) INPUT.NUMBER
END
And that will work fine for local use. However, when test.sno reads it and compiles it, INPUT.YEAR is supplied and the INPUT statement itself would block the run. One might argue then that my “inhale” function should also remove the INPUT statement. Clues to the issue can be seen in the test.sno code:
test.17
*#17. the sound for 105 is PlingPlangPlong as it has factors 3, 5 and 7
description = 'the sound for 105 is PlingPlangPlong as it has factors 3, 5 and 7'
expected = 'PlingPlangPlong'
property = 'convert'
input.number = 105
:<compiled>
:(test.after)
test.17.end
At this point I’m thinking of instructing the student to comment out their INPUT before running tests. I’m not satisfied with that idea however.