Verifies: SYS-REQ-026 [malformed] Malformed input outside addressed path allows best-effort result.
(t *testing.T)
| 1096 | // Verifies: SYS-REQ-026 [malformed] |
| 1097 | // Malformed input outside addressed path allows best-effort result. |
| 1098 | func TestGetBestEffortMalformed(t *testing.T) { |
| 1099 | // Malformed after the value we're looking for |
| 1100 | data := []byte(`{"a":1,"b":INVALID}`) |
| 1101 | val, _, _, err := Get(data, "a") |
| 1102 | if err != nil { |
| 1103 | t.Fatalf("Get best-effort error: %v (should succeed for key before malformed section)", err) |
| 1104 | } |
| 1105 | if string(val) != "1" { |
| 1106 | t.Fatalf("Get best-effort = %q, want %q", string(val), "1") |
| 1107 | } |
| 1108 | } |
| 1109 | |
| 1110 | // Verifies: SYS-REQ-027 [malformed] |
| 1111 | // Unclassifiable token returns value-type error. |