Verifies: SYS-REQ-009 (Set) Verifies: SYS-REQ-114 (JSONPath compiled paths) reqproof:proptest:skip targeted witness/regression test; not a property-test subject
(t *testing.T)
| 147 | // Verifies: SYS-REQ-114 (JSONPath compiled paths) |
| 148 | // reqproof:proptest:skip targeted witness/regression test; not a property-test subject |
| 149 | func TestCompilePathSet(t *testing.T) { |
| 150 | path, err := CompilePath("users[0].name") |
| 151 | if err != nil { |
| 152 | t.Fatalf("CompilePath returned error: %v", err) |
| 153 | } |
| 154 | |
| 155 | got, err := path.Set([]byte(`{"users":[{"name":"Ada"}]}`), []byte(`"Grace"`)) |
| 156 | if err != nil { |
| 157 | t.Fatalf("Set returned error: %v", err) |
| 158 | } |
| 159 | want := []byte(`{"users":[{"name":"Grace"}]}`) |
| 160 | if !bytes.Equal(got, want) { |
| 161 | t.Fatalf("Set result = %s, want %s", got, want) |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | // Verifies: SYS-REQ-114 (JSONPath compiled paths) |
| 166 | // reqproof:proptest:skip targeted witness/regression test; not a property-test subject |
nothing calls this directly
no test coverage detected