Renamed files

This commit is contained in:
Martino Ferrari
2026-01-23 14:24:43 +01:00
parent 94ee7e4880
commit 7caf3a5da5
2 changed files with 5 additions and 3 deletions

40
test/parser_test.go Normal file
View File

@@ -0,0 +1,40 @@
package integration
import (
"testing"
"github.com/marte-community/marte-dev-tools/internal/parser"
)
func TestParseBasic(t *testing.T) {
input := `
#package PROJECT.SUB
// comment
+Node1 = {
Class = MyClass
Field1 = "value"
Field2 = 123
Field3 = true
+SubNode = {
Class = OtherClass
}
}
$Node2 = {
Class = AppClass
Array = {1 2 3}
}
`
p := parser.NewParser(input)
config, err := p.Parse()
if err != nil {
t.Fatalf("Parse error: %v", err)
}
if config.Package == nil || config.Package.URI != "PROJECT.SUB" {
t.Errorf("Expected package PROJECT.SUB, got %v", config.Package)
}
if len(config.Definitions) != 2 {
t.Errorf("Expected 2 definitions, got %d", len(config.Definitions))
}
}