Skip to content

Add basic language testing support#60

Open
msujew wants to merge 3 commits intomainfrom
msujew/testing
Open

Add basic language testing support#60
msujew wants to merge 3 commits intomainfrom
msujew/testing

Conversation

@msujew
Copy link
Copy Markdown
Member

@msujew msujew commented Apr 9, 2026

Closes #39

Adds a basic testing infrastructure for languages. Informed by Langium and other projects. Currently, only supports testing of parsing, AST nodes, linking and diagnostics/validation. Other testing features (for example, LSP stuff) can come later.

Adds test files for the statemachine and grammar language.

Copy link
Copy Markdown
Collaborator

@Lotes Lotes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea with the range and index markers. Here are some questions, suggestions and ideas.

Comment thread examples/statemachine/statemachine_test.go
}

func TestFindNamedNode(t *testing.T) {
f := fbtest.New(t, CreateServices())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the grouping of lines.

For examples/ code: you could prepend "arrange", "act", "assert" as a little guidance for adopters.

But I do not insist on it, just a nice-to-have...

Comment thread internal/grammar/grammar_diagnostic_test.go Outdated
Comment thread internal/grammar/grammar_diagnostic_test.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add testing infrastructure

2 participants