diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-07-25 15:34:25 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-07-25 15:34:25 +0200 |
commit | 5d1ddebcfdc372902d6b01f267b622094c2c751c (patch) | |
tree | 3e5ad07e9546888ce2d6f558ce9e5f513bbb519f /test | |
parent | e0609155a809167cb260a441f708362a189852ab (diff) |
Move trace filter from postprocessing to automata module
This drastically increases performance
Diffstat (limited to 'test')
-rwxr-xr-x | test/pta.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/pta.py b/test/pta.py index 25ec20c..8ca41aa 100755 --- a/test/pta.py +++ b/test/pta.py @@ -155,6 +155,14 @@ class TestPTA(unittest.TestCase): ['init', 'set2', 'set1'], ['init', 'set2', 'set2']]) + def test_dfs_trace_filter(self): + pta = PTA(['IDLE']) + pta.add_transition('UNINITIALIZED', 'IDLE', 'init') + pta.add_transition('IDLE', 'IDLE', 'set1') + pta.add_transition('IDLE', 'IDLE', 'set2') + self.assertEqual(sorted(dfs_tran_to_name(pta.dfs(2, trace_filter=[['init', 'set1', 'set2'], ['init', 'set2', 'set1']]), False)), + [['init', 'set1', 'set2'], ['init', 'set2', 'set1']]) + def test_dfs_accepting(self): pta = PTA(['IDLE', 'TX'], accepting_states = ['IDLE']) pta.add_transition('UNINITIALIZED', 'IDLE', 'init') |