A minimal Go utility for line-by-line assertion testing. Reads lines from standard input and compares each to the corresponding expected value provided as command-line arguments. Useful for simple test scripts and shell pipelines.
printf "foo\nbar\n" | ./expect foo bar- For each line of input,
expectcompares it to the corresponding argument. - If a line does not match, an error is printed to stderr.
- The program exits with the number of failed comparisons as the exit code.
- If there is no input, it exits with code 128.
$ printf "hello\nworld\n" | ./expect hello world
$ echo $?
0
$ printf "hello\nthere\n" | ./expect hello world
expected: 'world'
actual: 'there'
$ echo $?
1balazs4
Note: This readme.md was generated by AI (opencode v0.6.4, model: github-copilot/gpt-4.1), but all code is 100% manually written.