mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-06-18 06:16:05 +01:00
utils/types: fix toggle_set creation
Correctly handle the presence of both an element and its toggle in the input, and handle them base on order, e.g. toggle_set(['x', 'y', '~x']) --> {'y', '~x'} toggle_set(['~x', 'y', 'x']) --> {'y', 'x'}
This commit is contained in:
committed by
Marc Bonnici
parent
0f2de5f951
commit
5f00a94121
@ -190,3 +190,10 @@ class TestToggleSet(TestCase):
|
||||
|
||||
ts6 = ts2.merge_into(ts3).merge_with(ts1)
|
||||
assert_equal(ts6, toggle_set(['one', 'two', 'three', 'four', 'five', '~~']))
|
||||
|
||||
def test_order_on_create(self):
|
||||
ts1 = toggle_set(['one', 'two', 'three', '~one'])
|
||||
assert_equal(ts1, toggle_set(['~one', 'two', 'three']))
|
||||
|
||||
ts1 = toggle_set(['~one', 'two', 'three', 'one'])
|
||||
assert_equal(ts1, toggle_set(['one', 'two', 'three']))
|
||||
|
Reference in New Issue
Block a user