MCPcopy
hub / github.com/inancgumus/learngo / TestParserStopsOnErr

Function TestParserStopsOnErr

logparser/testing/report/parser_test.go:36–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

34}
35
36func TestParserStopsOnErr(t *testing.T) {
37 p := newParser("a.com 10 20")
38 p.Parse("b.com -1 -1")
39 p.Parse("neverparses.com 30 40")
40
41 s := p.Summarize()
42 if want, got := 10, s.Total().Visits; want != got {
43 t.Errorf("want: %d; got: %d", want, got)
44 }
45}
46
47func TestParserIncorrectFields(t *testing.T) {
48 tests := []struct {

Callers

nothing calls this directly

Calls 4

SummarizeMethod · 0.80
TotalMethod · 0.80
newParserFunction · 0.70
ParseMethod · 0.65

Tested by

no test coverage detected