Verifies: SYS-REQ-025 [boundary] String value returned without surrounding quotes and without unescaping.
(t *testing.T)
| 1080 | // Verifies: SYS-REQ-025 [boundary] |
| 1081 | // String value returned without surrounding quotes and without unescaping. |
| 1082 | func TestGetStringValueRaw(t *testing.T) { |
| 1083 | data := []byte(`{"a":"hello world"}`) |
| 1084 | val, dt, _, err := Get(data, "a") |
| 1085 | if err != nil { |
| 1086 | t.Fatalf("Get string value error: %v", err) |
| 1087 | } |
| 1088 | if dt != String { |
| 1089 | t.Fatalf("Get string value type = %v, want String", dt) |
| 1090 | } |
| 1091 | if string(val) != "hello world" { |
| 1092 | t.Fatalf("Get string value = %q, want %q", string(val), "hello world") |
| 1093 | } |
| 1094 | } |
| 1095 | |
| 1096 | // Verifies: SYS-REQ-026 [malformed] |
| 1097 | // Malformed input outside addressed path allows best-effort result. |