MCPcopy Index your code
hub / github.com/buger/jsonparser / TestParseBooleanPartialLiterals

Function TestParseBooleanPartialLiterals

deep_spec_test.go:491–501  ·  view source on GitHub ↗

============================================================================= ParseBoolean partial literals (SYS-REQ-057) ============================================================================= Verifies: SYS-REQ-057 [boundary] Partial boolean literals shall return MalformedValueError.

(t *testing.T)

Source from the content-addressed store, hash-verified

489// Verifies: SYS-REQ-057 [boundary]
490// Partial boolean literals shall return MalformedValueError.
491func TestParseBooleanPartialLiterals(t *testing.T) {
492 cases := []string{"tru", "fals", "t", "f", "tr", "fa", "TRUE", "FALSE"}
493 for _, input := range cases {
494 t.Run(input, func(t *testing.T) {
495 _, err := ParseBoolean([]byte(input))
496 if !errors.Is(err, MalformedValueError) {
497 t.Fatalf("ParseBoolean(%q) error = %v, want %v", input, err, MalformedValueError)
498 }
499 })
500 }
501}
502
503// =============================================================================
504// ParseInt boundary values (SYS-REQ-058, SYS-REQ-059, SYS-REQ-064)

Callers

nothing calls this directly

Calls 1

ParseBooleanFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…