Hi, I think it would be great to have an option --print-test-file-with-output which would print the test file together with the actual output, e.g.:
Running:
cat <<EOF > example.test
$ echo foo
>
bar
$ false
$ echo bar >&2
EOF
shelltest --print-test-file-with-output example.test
would yield this output:
$ echo foo
>
foo
$ false
>= 1
$ echo bar >&2
>2
bar
Example use:
shelltest --print-test-file-with-output example.test > tmp && mv tmp example.test
git diff
Or did I miss an option like that?
It would make it easy to generate expected results in new tests. We also could diff and review changes without manually updating parts of the test file.
I could probably implement this. But first a question: Can the program know, after parsing, what the shelltest input format was (v1, v2, v3)? So that it can generate the exact same format?