@@ -1246,6 +1246,7 @@ func TestParseWith(t *testing.T) {
12461246 {"WITH followed by EXCEPTION" , getWithClauseTokens (1 ), "Bison-exception-2.2" , false , 2 , nil },
12471247 {"WITH not followed by EXCEPTION" , getInvalidWithClauseTokens (1 ), "" , true , 2 , errors .New ("expected exception after 'WITH'" )},
12481248 {"not with" , getOrClauseTokens (1 ), "" , true , 1 , nil },
1249+ {"WITH not followed by any tokens" , getMalformedWithClauseTokens (1 ), "" , true , 2 , errors .New ("expected exception after 'WITH'" )},
12491250 }
12501251
12511252 for _ , test := range tests {
@@ -1292,6 +1293,13 @@ func getInvalidWithClauseTokens(index int) *tokenStream {
12921293 return getTokenStream (tokens , index )
12931294}
12941295
1296+ func getMalformedWithClauseTokens (index int ) * tokenStream {
1297+ var tokens []token
1298+ tokens = append (tokens , token {role : licenseToken , value : "Apache-2.0" })
1299+ tokens = append (tokens , token {role : operatorToken , value : "WITH" })
1300+ return getTokenStream (tokens , index )
1301+ }
1302+
12951303func getAndClauseTokens (index int ) * tokenStream {
12961304 var tokens []token
12971305 tokens = append (tokens , token {role : licenseToken , value : "MIT" })
0 commit comments