diff options
Diffstat (limited to 'driver')
-rw-r--r-- | driver/parser_test.go | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/driver/parser_test.go b/driver/parser_test.go index 272a14d..73d8fac 100644 --- a/driver/parser_test.go +++ b/driver/parser_test.go @@ -273,6 +273,48 @@ foo: "foo"; `, specErr: true, }, + // A production must not have a duplicate alternative. + { + specSrc: ` +s + : foo + | foo + ; +foo: "foo"; +`, + specErr: true, + }, + // A production must not have a duplicate alternative. + { + specSrc: ` +a + : foo + ; +b + : + | + ; +foo: "foo"; +`, + specErr: true, + }, + // A production must not have a duplicate alternative. + { + specSrc: ` +a + : foo + ; +b + : bar + ; +a + : foo + ; +foo: "foo"; +bar: "bar"; +`, + specErr: true, + }, } for i, tt := range tests { t.Run(fmt.Sprintf("#%v", i), func(t *testing.T) { |