(t *testing.T, str string)
| 290 | } |
| 291 | |
| 292 | func testScannerFailure(t *testing.T, str string) { |
| 293 | r := bytes.NewBufferString(str) |
| 294 | s := newScanner(r, "memory") |
| 295 | var tokens []tt |
| 296 | for s.Next() { |
| 297 | tokens = append(tokens, tt{ |
| 298 | ID: s.Token().ID, |
| 299 | Value: string(s.Token().Value), |
| 300 | }) |
| 301 | } |
| 302 | if err := s.LastError(); err == nil { |
| 303 | t.Fatalf("expecting error when scanning %q. got tokens %v", str, tokens) |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | func testScannerSuccess(t *testing.T, str string, expectedTokens []tt) { |
| 308 | r := bytes.NewBufferString(str) |
no test coverage detected
searching dependent graphs…