MCPcopy Create free account
hub / github.com/buger/jsonparser / TestCodeMCDC_LastTokenNewline

Function TestCodeMCDC_LastTokenNewline

mcdc_code_supplement_test.go:61–67  ·  view source on GitHub ↗

----------------------------------------------------------------------------- lastToken / tokenStart / tokenEnd — drive each whitespace branch. `lastToken` is reached via Set on a top-level key of a non-empty object that has trailing whitespace; `tokenStart`/`tokenEnd` are reached via Get on inputs

(t *testing.T)

Source from the content-addressed store, hash-verified

59
60// Verifies: SYS-REQ-009 [mcdc]
61func TestCodeMCDC_LastTokenNewline(t *testing.T) {
62 // Set a top-level key on an object with trailing '\n' whitespace forces
63 // lastToken to walk past '\n' (c == '\n' = T branch).
64 if _, err := Set([]byte("{\"a\":1}\n"), []byte(`42`), "b"); err != nil {
65 t.Fatalf("Set returned error: %v", err)
66 }
67}
68
69// Verifies: SYS-REQ-009 [mcdc]
70func TestCodeMCDC_LastTokenCarriageReturn(t *testing.T) {

Callers

nothing calls this directly

Calls 1

SetFunction · 0.85

Tested by

no test coverage detected