Verifies: SYS-REQ-024 [boundary] Escaped key in payload matches decoded path segment.
(t *testing.T)
| 1067 | // Verifies: SYS-REQ-024 [boundary] |
| 1068 | // Escaped key in payload matches decoded path segment. |
| 1069 | func TestGetEscapedKey(t *testing.T) { |
| 1070 | data := []byte(`{"a\nb":42}`) |
| 1071 | val, _, _, err := Get(data, "a\nb") |
| 1072 | if err != nil { |
| 1073 | t.Fatalf("Get escaped key error: %v", err) |
| 1074 | } |
| 1075 | if string(val) != "42" { |
| 1076 | t.Fatalf("Get escaped key = %q, want %q", string(val), "42") |
| 1077 | } |
| 1078 | } |
| 1079 | |
| 1080 | // Verifies: SYS-REQ-025 [boundary] |
| 1081 | // String value returned without surrounding quotes and without unescaping. |