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
24ea6df1
Commit
24ea6df1
authored
Jun 10, 2021
by
Vladimír Štill
Browse files
test: Ensure combound rules are forbidden, close
#3
parent
db6b461f
Pipeline
#95276
passed with stage
in 1 minute and 26 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test_reg.py
View file @
24ea6df1
...
...
@@ -21,3 +21,11 @@ def test_can() -> None:
auto_can
=
parse
(
"init=x (x,a)=z (x,b)=y (y,a)=z (y,b)=z (z,a)=z (z,b)=z final={z}"
).
canonize
()
expect_can
=
parse
(
"init=1 (1,a)=2 (1,b)=3 (2,a)=2 (2,b)=2 (3,a)=2 (3,b)=2 final={2}"
)
assert
DFA
.
is_identical
(
auto_can
,
expect_can
),
f
"
{
to_str
(
auto_can
)
}
≠
{
to_str
(
expect_can
)
}
"
def
test_invalid
()
->
None
:
try
:
lib
.
parser
.
dfa
(
"init=A (A,ab)=A (A,c)=B (B,ab)=B final={B}"
)
assert
False
,
"should not parse (long/compound terminal)"
except
:
pass
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