diff options
author | EuAndreh <eu@euandre.org> | 2024-12-12 11:04:07 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-12-12 11:04:07 -0300 |
commit | 597687f4aea38ef19d12e0fdaf021fa4faba8f02 (patch) | |
tree | e65ffaa7c9fc4f39826c36825e73eb81765add16 /tests/unit/driver | |
parent | Build and run existing test executables with no actual tests (diff) | |
download | cotia-597687f4aea38ef19d12e0fdaf021fa4faba8f02.tar.gz cotia-597687f4aea38ef19d12e0fdaf021fa4faba8f02.tar.xz |
tests/unit/: Actually run existing tests
Diffstat (limited to 'tests/unit/driver')
-rw-r--r-- | tests/unit/driver/lexer/lexer.go | 19 | ||||
-rw-r--r-- | tests/unit/driver/parser/parser.go | 23 |
2 files changed, 40 insertions, 2 deletions
diff --git a/tests/unit/driver/lexer/lexer.go b/tests/unit/driver/lexer/lexer.go index 364a0f5..f01dbf7 100644 --- a/tests/unit/driver/lexer/lexer.go +++ b/tests/unit/driver/lexer/lexer.go @@ -3,13 +3,17 @@ package lexer import ( "bytes" "fmt" + "os" "strings" "testing" + "testing/internal/testdeps" "urubu/grammar/lexical" spec "urubu/spec/grammar" ) + + func newLexEntry(modes []string, kind string, pattern string, push string, pop bool) *lexical.LexEntry { ms := []spec.LexModeName{} for _, m := range modes { @@ -932,4 +936,17 @@ func testToken(t *testing.T, expected, actual *Token) { } -func MainTest() {} + +func MainTest() { + tests := []testing.InternalTest{ + { "TestLexer_Next", TestLexer_Next }, + { "TestLexer_Next_WithPosition", TestLexer_Next_WithPosition }, + } + + deps := testdeps.TestDeps{} + benchmarks := []testing.InternalBenchmark {} + fuzzTargets := []testing.InternalFuzzTarget{} + examples := []testing.InternalExample {} + m := testing.MainStart(deps, tests, benchmarks, fuzzTargets, examples) + os.Exit(m.Run()) +} diff --git a/tests/unit/driver/parser/parser.go b/tests/unit/driver/parser/parser.go index cdf32a3..7ce5d60 100644 --- a/tests/unit/driver/parser/parser.go +++ b/tests/unit/driver/parser/parser.go @@ -2,15 +2,19 @@ package parser import ( "fmt" + "os" "sort" "strings" "testing" + "testing/internal/testdeps" "urubu/grammar" spec "urubu/spec/grammar" "urubu/spec/grammar/parser" ) + + func TestParserWithConflicts(t *testing.T) { tests := []struct { caption string @@ -1972,4 +1976,21 @@ foo } -func MainTest() {} + +func MainTest() { + tests := []testing.InternalTest{ + { "TestParserWithConflicts", TestParserWithConflicts }, + { "TestParserWithLAC", TestParserWithLAC }, + { "TestParser_Parse", TestParser_Parse }, + { "TestParserWithSemanticAction", TestParserWithSemanticAction }, + { "TestParserWithSyntaxErrors", TestParserWithSyntaxErrors }, + { "TestParserWithSyntaxErrorAndExpectedLookahead", TestParserWithSyntaxErrorAndExpectedLookahead }, + } + + deps := testdeps.TestDeps{} + benchmarks := []testing.InternalBenchmark {} + fuzzTargets := []testing.InternalFuzzTarget{} + examples := []testing.InternalExample {} + m := testing.MainStart(deps, tests, benchmarks, fuzzTargets, examples) + os.Exit(m.Run()) +} |