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

Function TestPropertySameTreeEquivalence

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

--------------------------------------------------------------------------- Property: sameTree is reflexive and symmetric --------------------------------------------------------------------------- reqproof:proptest sameTree Verifies: SYS-REQ-009 [property]

(t *testing.T)

Source from the content-addressed store, hash-verified

801// reqproof:proptest sameTree
802// Verifies: SYS-REQ-009 [property]
803func TestPropertySameTreeEquivalence(t *testing.T) {
804 // Reflexive: sameTree(p,p) is true for any non-empty path.
805 reflexive := func(p []string) bool {
806 if len(p) == 0 {
807 return true
808 }
809 return sameTree(p, p)
810 }
811 if err := quick.Check(reflexive, &quick.Config{MaxCount: 2000}); err != nil {
812 t.Fatalf("sameTree not reflexive: %v", err)
813 }
814}
815
816// ---------------------------------------------------------------------------
817// Property: internalGet agrees with Get (Get is a thin projection)

Callers

nothing calls this directly

Calls 1

sameTreeFunction · 0.85

Tested by

no test coverage detected