Fetch stdin from file as an alternative to inlining it into test suite
pdawyndt opened this issue · 1 comments
As an alternative to inlining content linked to the stdin channel into the test suite, we could also feed that content from a file. This would have several advantages:
- content does not clutter test suite (especially problematic with large files)
- input redirection becomes part of the description of the test instead of displaying
stdin
as a separate channel next tostdout
orreturn
- content does not clutter feedback table as we could also add file link there (especially beneficial for large files; also bypasses HTML-checking on this content)
- may even allow to work with non-textual content linked to stdin
I would definitely also use the alternative of inlining (short) stdin content in the test suite. When it comes to the feedback table, we might even consider different ways to represent short/long content fed to the stdin
channel (show entirely or link to file that can be downloaded). This could follow the way it is specified in the test suite (inline/file) by default, and might even be overruled using a parameter (auto/inline/file
).
Example use case: exercise "Wandelende vingers" (reeks 07) of the "Computergebruik" repository.
$ wandelingen "qwertyuytresdftyuiokn" < woordenboek.txt
queen
question
Now that we use HERE-docs for inlining stdin, this is just an alternative with files redirected to stdin. In case of file-based stdin, we could always use the command line description, even if there are no arguments.