aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/grammar/lexical/dfa/dfa.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/grammar/lexical/dfa/dfa.go')
-rw-r--r--tests/unit/grammar/lexical/dfa/dfa.go21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/unit/grammar/lexical/dfa/dfa.go b/tests/unit/grammar/lexical/dfa/dfa.go
index 3233969..b3c0b75 100644
--- a/tests/unit/grammar/lexical/dfa/dfa.go
+++ b/tests/unit/grammar/lexical/dfa/dfa.go
@@ -2,13 +2,17 @@ package dfa
import (
"fmt"
+ "os"
"strings"
"testing"
+ "testing/internal/testdeps"
"urubu/grammar/lexical/parser"
spec "urubu/spec/grammar"
)
+
+
func TestGenDFA(t *testing.T) {
p := parser.NewParser(spec.LexKindName("test"), strings.NewReader("(a|b)*abb"))
cpt, err := p.Parse()
@@ -442,4 +446,19 @@ func testSymbolTable(t *testing.T, expected, actual *symbolTable) {
}
-func MainTest() {}
+
+func MainTest() {
+ tests := []testing.InternalTest{
+ { "TestGenDFA", TestGenDFA },
+ { "TestNewSymbolPosition", TestNewSymbolPosition },
+ { "TestByteTree", TestByteTree },
+ { "TestFollowAndSymbolTable", TestFollowAndSymbolTable },
+ }
+
+ deps := testdeps.TestDeps{}
+ benchmarks := []testing.InternalBenchmark {}
+ fuzzTargets := []testing.InternalFuzzTarget{}
+ examples := []testing.InternalExample {}
+ m := testing.MainStart(deps, tests, benchmarks, fuzzTargets, examples)
+ os.Exit(m.Run())
+}