echo(1) acceptance tests

The Subplot project

1 Introduction

echo(1) is a Unix command line tool, which writes its command line arguments to the standard output. This is a simple acceptance test suite for the /bin/echo implementation.

2 No arguments

Run /bin/echo without arguments.

when user runs echo without arguments
then exit code is 0
then standard output contains a newline
then standard error is empty

3 Hello, world

This scenario runs /bin/echo to produce the output “hello, world”.

when user runs echo with arguments hello, world
then exit code is 0
then standard output contains "hello, world"
then standard error is empty

Test file

File: foo.dat
This is a test file.
Two lines.