github.com/blueinnovationsgroup/can-go@v0.0.0-20230518195432-d0567cda0028/pkg/dbc/analysis/passes/uniquenodenames/analyzer_test.go (about) 1 package uniquenodenames 2 3 import ( 4 "testing" 5 "text/scanner" 6 7 "github.com/blueinnovationsgroup/can-go/pkg/dbc/analysis" 8 "github.com/blueinnovationsgroup/can-go/pkg/dbc/analysis/analysistest" 9 ) 10 11 func TestAnalyzer(t *testing.T) { 12 analysistest.Run(t, Analyzer(), []*analysistest.Case{ 13 { 14 Name: "ok", 15 Data: `BU_: ECU1 ECU2 ECU3`, 16 }, 17 18 { 19 Name: "duplicates", 20 Data: `BU_: ECU1 ECU2 ECU3 ECU1`, 21 Diagnostics: []*analysis.Diagnostic{ 22 { 23 Pos: scanner.Position{Line: 1, Column: 1}, 24 Message: "non-unique node name", 25 }, 26 }, 27 }, 28 }) 29 }