title: "seq(1) acceptance tests" author: The Subplot project bindings:
- lib/runcmd.yaml
- seq-extras.yaml
impls:
rust:
- seq-extras.rs ...
1 Introduction
seq(1) is a Unix command line tool that produces numbers 1, 2,
etc, up until a count given by the user. For example, if the user runs
seq 3
, the output has the numbers 1, 2, and 3, one per line.
2 No arguments
Requirement: If seq
is run without arguments, it reports an error.
1 when I try to run seq
2 then exit code is 1
3 One number
Requirement: If seq
is run with the argument 1, it writes one line,
with the number 1.
1 when I run seq 1
2 then stdout is exactly "1
"
3 then stderr is exactly ""
4 More than one number
Requirement: If seq
is run with the argument 3, it writes three lines,
one with the number 1, one with 2, and one with 3.
1 when I run seq 3
2 then stdout has 3 lines
3 then stdout is exactly "1
2
3
"
4 then stderr is exactly ""
5 Not a number
Requirement: If seq
is run with a non-numerical argument, it writes nothing
to stdout, and an error message to stderr.
1 when I try to run seq fish
2 then command fails
3 then stdout is exactly ""
4 then stderr says fish is invalid