MCPcopy
hub / github.com/valyala/quicktemplate / testScannerFailure

Function testScannerFailure

parser/scanner_test.go:292–305  ·  view source on GitHub ↗
(t *testing.T, str string)

Source from the content-addressed store, hash-verified

290}
291
292func 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
307func testScannerSuccess(t *testing.T, str string, expectedTokens []tt) {
308 r := bytes.NewBufferString(str)

Callers 5

TestScannerPlainFailureFunction · 0.85
TestScannerFailureFunction · 0.85

Calls 4

newScannerFunction · 0.85
NextMethod · 0.80
TokenMethod · 0.80
LastErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…