dodona-edu / universal-judge

Universal judge for educational software testing
https://docs.dodona.be/en/tested
MIT License
9 stars 5 forks source link

Show stdin as a separate channel when used in combination with arguments #484

Closed pdawyndt closed 9 months ago

pdawyndt commented 9 months ago

When stdin is used in combination with arguments in the same testcase, both the arguments and stdin as used together in the description of the testcase (on separate lines). I would consider the feedback more readable if stdin were rendered as a separate (multiline) channel in this case. When stdin is used without arguments, we could still use stdin as the testcase description as is the case right now.

pdawyndt commented 9 months ago

As an alternative, we could use HERE-document style, which immediately reflects how it works on the command line. Added value: students can copy-paste this and apply it in their shell, and we could use the STDIN token for the HERE-document to underscore that the content is connected to the stdin-channel.

$ valknut key.01.txt << 'STDIN'
-;7X74woa#pG47lXG4lX7:4woa#pG4R77R;4lX74&7lXS
STDIN
pdawyndt commented 9 months ago

For short (single-line strings) we could even go for

$ valknut key.01.txt <<< "-;7X74woa#pG47lXG4lX7:4woa#pG4R77R;4lX74&7lXS"