Tests for wc
This Falderal document was written by Chris Pressey. It is hereby placed in the public domain.
This test suite demonstrates how Falderal can specify tests for functionalities which have multiple implementations.
Functionality "Count lines" is implemented by
shell command "wc -l"
Functionality "Count lines" is implemented by
shell command "wc -l >%(output-file)"
Functionality "Count lines" is implemented by
Haskell function WordCount:countLines
Tests for functionality "Count lines"
Lines are counted correctly.
These are eight words
that span
three lines.
= 3
Tests for shell command "wc -l %(test-file)"
These are eight words
that span
three lines.
= 3 input.txt
Functionality "Count words" is implemented by
shell command "wc -w"
Tests for functionality "Count words"
These are eight words
that span
three lines.
= 8
Here are eight words on a single line.
= 8
An intentionally failing test.
Not four words!
= 4
