Skip to content

Commit

Permalink
Refactoring tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mapio committed Apr 5, 2024
1 parent 6ee6841 commit 86c93a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/tests/automaton_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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 -> ♯')
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 86c93a6

Please sign in to comment.