MCPcopy Index your code
hub / github.com/Shopify/go-lua / testScanner

Function testScanner

scanner_test.go:45–56  ·  view source on GitHub ↗
(t *testing.T, n int, source string, tokens []token)

Source from the content-addressed store, hash-verified

43}
44
45func testScanner(t *testing.T, n int, source string, tokens []token) {
46 s := scanner{r: strings.NewReader(source)}
47 for i, expected := range tokens {
48 if result := s.scan(); result != expected {
49 t.Errorf("[%d] expected token %s but found %s at %d", n, expected, result, i)
50 }
51 }
52 expected := token{t: tkEOS}
53 if result := s.scan(); result != expected {
54 t.Errorf("[%d] expected token %s but found %s", n, expected, result)
55 }
56}
57
58func (t token) String() string {
59 tok := string(t.t)

Callers 1

TestScannerFunction · 0.85

Calls 1

scanMethod · 0.95

Tested by

no test coverage detected