Verifies: SYS-REQ-112 (container length accessor). reqproof:proptest:skip targeted witness/regression test; not a property-test subject
(t *testing.T)
| 251 | // Verifies: SYS-REQ-112 (container length accessor). |
| 252 | // reqproof:proptest:skip targeted witness/regression test; not a property-test subject |
| 253 | func TestGetArrayLenRoundTrip(t *testing.T) { |
| 254 | data := []byte(`{"values":[1,"two,three",{"four":[4,5]},[6,7],null]}`) |
| 255 | |
| 256 | got, err := GetArrayLen(data, "values") |
| 257 | if err != nil { |
| 258 | t.Fatalf("GetArrayLen() unexpected error: %v", err) |
| 259 | } |
| 260 | |
| 261 | callbacks := 0 |
| 262 | _, err = ArrayEach(data, func(_ []byte, _ ValueType, _ int, callbackErr error) { |
| 263 | if callbackErr != nil { |
| 264 | t.Errorf("ArrayEach callback error: %v", callbackErr) |
| 265 | return |
| 266 | } |
| 267 | callbacks++ |
| 268 | }, "values") |
| 269 | if err != nil { |
| 270 | t.Fatalf("ArrayEach() unexpected error: %v", err) |
| 271 | } |
| 272 | if got != callbacks { |
| 273 | t.Fatalf("GetArrayLen() = %d, ArrayEach callbacks = %d", got, callbacks) |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | // Verifies: SYS-REQ-112 (container length accessor). |
| 278 | // reqproof:proptest:skip targeted witness/regression test; not a property-test subject |
nothing calls this directly
no test coverage detected