summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/pta.py8
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')