-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add tests for
graph_to_nfa
and regex_to_dfa
functions
- Loading branch information
Showing
5 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from project.regex_utils import regex_to_dfa | ||
|
||
|
||
def test_regex_to_dfa(): | ||
res = regex_to_dfa("a.b.c*|d") | ||
|
||
assert res.is_equivalent_to(res.minimize()) | ||
assert res.is_deterministic() | ||
assert res.accepts("abccc") | ||
assert res.accepts("d") | ||
assert not res.accepts("cd") |