Don't try to run tests if node.js is not on the search path.
Chris Pressey
6 years ago
0 | 0 | #!/bin/sh |
1 | ||
2 | NODE="node" | |
3 | if [ x`which $NODE` = x ]; then | |
4 | echo "$NODE not found on search path. Tests not run." | |
5 | exit 0 | |
6 | fi | |
1 | 7 | |
2 | 8 | assert() { |
3 | 9 | COMMAND=$1 |
16 | 22 | assert "echo 'Hello' | src/lexeduct.js chars=' ' insert-chars" "H e l l o " |
17 | 23 | assert "echo 'Hello' | src/lexeduct.js chars='a' insert-chars upper" "HAEALALAOA" |
18 | 24 | assert "echo 'Hello' | src/lexeduct.js upper chars='a' insert-chars" "HaEaLaLaOa" |
25 | ||
26 | echo "All tests passed." |