|
| 1 | +setup() { |
| 2 | + run ./build/duplo -ml 2 tests/Simple_Ada/simple_log.lst out.txt |
| 3 | +} |
| 4 | + |
| 5 | +@test "simple_log.adb" { |
| 6 | + [ "$status" -eq 0 ] |
| 7 | + [ "${lines[0]}" = "Loading and hashing files ... 2 done." ] |
| 8 | + [ "${lines[1]}" = "tests/Simple_Ada/simple_log.adb found: 6 block(s)" ] |
| 9 | +} |
| 10 | + |
| 11 | +@test "simple_log.adb out.txt" { |
| 12 | + run cat out.txt |
| 13 | + printf 'Lines:\n' |
| 14 | + printf 'lines %s\n' "${lines[@]}" >&2 |
| 15 | + printf 'output %s\n' "${output[@]}" >&2 |
| 16 | + [ "${lines[0]}" = "tests/Simple_Ada/simple_log.adb(29)" ] |
| 17 | + [ "${lines[1]}" = "tests/Simple_Ada/simple_log.adb(20)" ] |
| 18 | + [ "${lines[4]}" = "tests/Simple_Ada/simple_log.adb(37)" ] |
| 19 | + [ "${lines[5]}" = "tests/Simple_Ada/simple_log.adb(29)" ] |
| 20 | + [ "${lines[8]}" = "tests/Simple_Ada/simple_log.adb(45)" ] |
| 21 | + [ "${lines[9]}" = "tests/Simple_Ada/simple_log.adb(37)" ] |
| 22 | + [ "${lines[12]}" = "tests/Simple_Ada/simple_log.adb(37)" ] |
| 23 | + [ "${lines[13]}" = "tests/Simple_Ada/simple_log.adb(20)" ] |
| 24 | + [ "${lines[16]}" = "tests/Simple_Ada/simple_log.adb(45)" ] |
| 25 | + [ "${lines[17]}" = "tests/Simple_Ada/simple_log.adb(29)" ] |
| 26 | + [ "${lines[20]}" = "tests/Simple_Ada/simple_log.adb(45)" ] |
| 27 | + [ "${lines[21]}" = "tests/Simple_Ada/simple_log.adb(20)" ] |
| 28 | + [ "${lines[24]}" = "Configuration:" ] |
| 29 | + [ "${lines[25]}" = " Number of files: 1" ] |
| 30 | + [ "${lines[26]}" = " Minimal block size: 2" ] |
| 31 | + [ "${lines[27]}" = " Minimal characters in line: 3" ] |
| 32 | + [ "${lines[28]}" = " Ignore preprocessor directives: 0" ] |
| 33 | + [ "${lines[29]}" = " Ignore same filenames: 0" ] |
| 34 | + [ "${lines[30]}" = "Results:" ] |
| 35 | + [ "${lines[31]}" = " Lines of code: 33" ] |
| 36 | + [ "${lines[32]}" = " Duplicate lines of code: 12" ] |
| 37 | + [ "${lines[33]}" = " Total 6 duplicate block(s) found." ] |
| 38 | +} |
0 commit comments