(t *testing.T, tcs []lexerTestCase)
| 208 | } |
| 209 | |
| 210 | func testLexer(t *testing.T, tcs []lexerTestCase) { |
| 211 | for _, tc := range tcs { |
| 212 | t.Run(tc.input, func(t *testing.T) { |
| 213 | actual := []int{} |
| 214 | l := lexer{ |
| 215 | Scanner: scanner.Scanner{ |
| 216 | Mode: scanner.SkipComments | scanner.ScanStrings, |
| 217 | }, |
| 218 | } |
| 219 | l.Init(strings.NewReader(tc.input)) |
| 220 | var lval yySymType |
| 221 | for { |
| 222 | tok := l.Lex(&lval) |
| 223 | if tok == 0 { |
| 224 | break |
| 225 | } |
| 226 | actual = append(actual, tok) |
| 227 | } |
| 228 | |
| 229 | require.Equal(t, tc.expected, actual) |
| 230 | }) |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | func TestContainsNonAttributeRune(t *testing.T) { |
| 235 | tests := []struct { |
no test coverage detected