Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
fja
eval
Commits
df5aa4c3
Commit
df5aa4c3
authored
Apr 03, 2021
by
Vladimír Štill
Browse files
test: Add test for is_canonical
parent
4b9069b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
test_reg.py
0 → 100644
View file @
df5aa4c3
from
lib.parsing.parser
import
Parser
def
is_can
(
dfa
:
str
)
->
bool
:
parser
=
Parser
()
return
parser
.
str_to_dfa
(
dfa
).
is_canonical
()
def
test_can
()
->
None
:
assert
is_can
(
"init=1 (1,a)=1 (1,b)=2 (2,b)=1 (2,a)=1 final={2}"
)
assert
is_can
(
"init=1 (1,b)=3 (1,a)=2 (2,b)=1 (2,a)=1 (3,a)=2 (3,b)=2 final={2}"
)
assert
not
is_can
(
"init=1 (1,b)=3 (1,c)=2 (2,b)=1 (2,a)=1 (3,a)=2 (3,b)=2 final={2}"
)
assert
not
is_can
(
"init=1 (1,a)=1 (1,b)=2 (2,b)=1 (2,b)=1 (unreach,a)=1 (unreach,b)=unreach final={2}"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment