Skip to content

Commit

Permalink
Add unit test for compact input case
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitrazet committed Jun 14, 2022
1 parent 8d9bf9f commit de71aaf
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/determinize/Det010.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- testing avoiding state explosion

def Main =
First
block $$ = $[0xFE]; $[0x01]
$[ !0xFE ]
22 changes: 22 additions & 0 deletions tests/determinize/Det010.ddl.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module Det010

--- Imports:

--- Type defs:

--- Rules:

Det010.Main : Grammar (uint 8) =
Choose biased
{ do ($$ : uint 8) <- Match {0xFE}
@Match {0x01}
pure $$
| Match (!{0xFE})
}

Det010.Main_ : Grammar {} =
Choose biased
{ do @Match {0xFE}
@Match {0x01}
| @Match (!{0xFE})
}
4 changes: 4 additions & 0 deletions tests/determinize/Det010.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dump
Det010.ddl
--core
--determinize
24 changes: 24 additions & 0 deletions tests/determinize/Det010.test.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module DaedalusMain where


-------------

-- entry pont
-- ./Det010.ddl:3:1--6:14
proc Main() : Word 8 =
-- ./Det010.ddl:4:3--6:14
-- DETERMINIZE 1 Fully
do _x0 <- match1 { ... }
case _x0 of
254 ->
-- ./Det010.ddl:5:11--5:12
-- ./Det010.ddl:5:16--5:22
do let $$ = 254 @(Word 8)
-- ./Det010.ddl:5:25--5:12
-- ./Det010.ddl:5:25--5:31
match1_ { 1 @(Word 8) }
-- ./Det010.ddl:5:11--5:12
pure $$
_ ->
-- ./Det010.ddl:6:5--6:14
pure _x0

0 comments on commit de71aaf

Please sign in to comment.