Skip to content

Commit d6fe4f9

Browse files
committed
fix use a string that really should not match
1 parent 35f52dc commit d6fe4f9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/framework/easyconfigversion.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,10 @@ def test_parser_toolchain_regex(self):
190190
self.assertEqual(tcversop.as_dict(), as_dict)
191191

192192
# only accept known toolchain names
193+
RANDOM_BIT = 'ShouldNotMatch___'
193194
fail_tests = [
194-
"x%s >= 1.2.3" % tc,
195-
"%sx >= 1.2.3" % tc,
195+
f"{RANDOM_BIT}{tc} >= 1.2.3",
196+
f"{tc}{RANDOM_BIT} >= 1.2.3",
196197
"foo",
197198
">= 1.2.3",
198199
]
@@ -205,6 +206,7 @@ def test_parser_toolchain_regex(self):
205206
def test_toolchain_versop_test(self):
206207
"""Test the ToolchainVersionOperator test"""
207208
_, tcs = search_toolchain('')
209+
RANDOM_BIT = 'ShouldNotMatch___'
208210
tc_names = [x.NAME for x in tcs]
209211
for tc in tc_names: # test all known toolchain names
210212
# test version expressions with optional version operator
@@ -213,8 +215,8 @@ def test_toolchain_versop_test(self):
213215
(tc, '1.2.3', True), # version ok, name ok
214216
(tc, '1.2.4', True), # version ok, name ok
215217
(tc, '1.2.2', False), # version not ok, name ok
216-
('x' + tc, '1.2.3', False), # version ok, name not ok
217-
('x' + tc, '1.2.2', False), # version not ok, name not ok
218+
(RANDOM_BIT + tc, '1.2.3', False), # version ok, name not ok
219+
(RANDOM_BIT + tc, '1.2.2', False), # version not ok, name not ok
218220
)),
219221
]
220222
for txt, subtests in tests:

0 commit comments

Comments
 (0)