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

Function TestPropertyValueTypeStringer

property_test.go:790–814  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Property: ValueType.String round-trips for all enumerated tags --------------------------------------------------------------------------- reqproof:proptest String Verifies: SYS-REQ-001 [property]

(t *testing.T)

Source from the content-addressed store, hash-verified

788// reqproof:proptest String
789// Verifies: SYS-REQ-001 [property]
790func TestPropertyValueTypeStringer(t *testing.T) {
791 for _, tc := range []struct {
792 vt ValueType
793 want string
794 }{
795 {NotExist, "non-existent"},
796 {String, "string"},
797 {Number, "number"},
798 {Object, "object"},
799 {Array, "array"},
800 {Boolean, "boolean"},
801 {Null, "null"},
802 } {
803 got := tc.vt.String()
804 if got != tc.want {
805 t.Fatalf("ValueType(%d).String() = %q, want %q", tc.vt, got, tc.want)
806 }
807 }
808 // Determinism: same value → same string across many calls.
809 for i := 0; i < 100; i++ {
810 if String.String() != "string" {
811 t.Fatalf("ValueType.String non-deterministic")
812 }
813 }
814}
815
816// ---------------------------------------------------------------------------
817// Property: all fuzz harnesses from fuzz.go never panic on arbitrary bytes

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected