From: Florian Westphal Date: Fri, 16 Aug 2019 10:32:19 +0000 (+0200) Subject: tests: make sure i is defined X-Git-Tag: v0.9.2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ff3e2b18305af07d322eef26111aa7ec4bde79d;p=thirdparty%2Fnftables.git tests: make sure i is defined The test script can die in case there are severe problems, such as rlen being 0 -- in that case i is undefined and script evaluation is aborted. Found during nft development, no existing test case shows this problem. Signed-off-by: Florian Westphal --- diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index 7f424cf1..bc0849e0 100755 --- a/tests/py/nft-test.py +++ b/tests/py/nft-test.py @@ -138,6 +138,7 @@ def color_differences(rule, other, color): rlen = len(rule) olen = len(other) out = "" + i = 0 # find equal part at start for i in range(rlen):