Ron Yorston | c849e72 | 2021-01-21 08:40:54 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Copyright 2021 by Ron Yorston |
| 3 | # Licensed under GPLv2, see file LICENSE in this source tree. |
| 4 | |
| 5 | . ./testing.sh |
| 6 | |
| 7 | # testing "test name" "commands" "expected result" "file input" "stdin" |
| 8 | |
| 9 | testing "nl numbers all lines" \ |
| 10 | "nl -b a input" \ |
| 11 | "\ |
| 12 | 1 line 1 |
| 13 | 2 |
| 14 | 3 line 3 |
| 15 | " \ |
| 16 | "line 1\n\nline 3\n" \ |
| 17 | "" |
| 18 | |
| 19 | testing "nl numbers non-empty lines" \ |
| 20 | "nl -b t input" \ |
| 21 | "\ |
| 22 | 1 line 1 |
| 23 | |
| 24 | 2 line 3 |
| 25 | " \ |
| 26 | "line 1\n\nline 3\n" \ |
| 27 | "" |
| 28 | |
| 29 | testing "nl numbers no lines" \ |
| 30 | "nl -b n input" \ |
| 31 | "\ |
| 32 | line 1 |
| 33 | |
| 34 | line 3 |
| 35 | " \ |
| 36 | "line 1\n\nline 3\n" \ |
| 37 | "" |
| 38 | |
| 39 | exit $FAILCOUNT |