From 86c93a65d674561fe8303d12d7df7e8d307bf124 Mon Sep 17 00:00:00 2001 From: Massimo Santini Date: Fri, 5 Apr 2024 12:36:13 +0200 Subject: [PATCH] Refactoring tests --- src/tests/automaton_test.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tests/automaton_test.py b/src/tests/automaton_test.py index 322da4f..c8fe774 100644 --- a/src/tests/automaton_test.py +++ b/src/tests/automaton_test.py @@ -207,7 +207,7 @@ def test_TDID_init(self): """ ) i = TopDownInstantaneousDescription(G, 'aaba') - self.assertEqual('(), S♯, \x1b[48;5;252m\x1b[0maaba♯', str(i)) + self.assertEqual('(), S♯, |aaba♯', str(i)) def test_BUID_init(self): G = Grammar.from_string( @@ -218,7 +218,7 @@ def test_BUID_init(self): """ ) i = BottomUpInstantaneousDescription(G, 'abc') - self.assertEqual('(), , \x1b[48;5;252m\x1b[0mabc', str(i)) + self.assertEqual('(), , |abc', str(i)) def test_TDID_init_exception(self): G = Grammar.from_string('S -> ♯') @@ -235,7 +235,7 @@ def test_TDID_predict(self): ) i = TopDownInstantaneousDescription(G, 'aaba') i = i.predict(G.P[0]) - self.assertEqual('(S -> a\u200aB\u200aC,), aBC♯, \x1b[48;5;252m\x1b[0maaba♯', str(i)) + self.assertEqual('(S -> a\u200aB\u200aC,), aBC♯, |aaba♯', str(i)) def test_TDID_predict_exception0(self): G = Grammar.from_string( @@ -271,7 +271,7 @@ def test_BUID_reduce(self): ) i = BottomUpInstantaneousDescription(G, 'abc') i = i.shift().shift().reduce(G.P[1]) - self.assertEqual('(A -> a\u200ab,), (A: (a), (b)), \x1b[48;5;252mab\x1b[0mc', str(i)) + self.assertEqual('(A -> a\u200ab,), (A: (a), (b)), ab|c', str(i)) def test_BUID_reduce_exception0(self): G = Grammar.from_string( @@ -307,7 +307,7 @@ def test_TDID_match(self): ) i = TopDownInstantaneousDescription(G, 'aaba') i = i.predict(G.P[0]).match() - self.assertEqual('(S -> a\u200aB\u200aC,), BC♯, \x1b[48;5;252ma\x1b[0maba♯', str(i)) + self.assertEqual('(S -> a\u200aB\u200aC,), BC♯, a|aba♯', str(i)) def test_TDID_match_exception(self): G = Grammar.from_string( @@ -331,7 +331,7 @@ def test_BUID_shift(self): ) i = BottomUpInstantaneousDescription(G, 'abc') i = i.shift() - self.assertEqual('(), (a), \x1b[48;5;252ma\x1b[0mbc', str(i)) + self.assertEqual('(), (a), a|bc', str(i)) def test_TDID_done(self): G = Grammar.from_string(