]> git.ipfire.org Git - thirdparty/iptables.git/commit
tests: xlate-test: Don't skip any input after the first empty line
authorPhil Sutter <phil@nwl.cc>
Mon, 6 Sep 2021 10:52:22 +0000 (12:52 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 13 Sep 2021 15:00:51 +0000 (17:00 +0200)
commitfa78ff15602598a5a0f229055455e67757539372
tree3b3f6d3f3e65679cc7e1187f8db69e5b6cd6633a
parentfcbe454bf0d05612a8484723fd3e9299d4ee836f
tests: xlate-test: Don't skip any input after the first empty line

In conditionals, testing the empty string evaluates to false. This is
dumb but seems intentional, as readline() method returns an empty string
at EOF. This is distinct from reading an empty line as the latter
contains the newline character - unless it is stripped in between
readline() and conditional. The fixed commit introduced just that by
accident, effectively reducing any test file to the first contained
test:

| $ ./xlate-test.py
| [...]
| 81 test files, 84 tests, 84 tests passed, 0 tests failed, 0 errors

With this change in place, the summary looks much better:

| 81 test files, 368 tests, 368 tests passed, 0 tests failed, 0 errors

Fixes: 62828a6aff231 ("tests: xlate-test: support multiline expectation")
Signed-off-by: Phil Sutter <phil@nwl.cc>
xlate-test.py