diff --git a/json-path/src/test/java/com/jayway/jsonpath/JsonPathTest.java b/json-path/src/test/java/com/jayway/jsonpath/JsonPathTest.java index f997eed8..154855a1 100644 --- a/json-path/src/test/java/com/jayway/jsonpath/JsonPathTest.java +++ b/json-path/src/test/java/com/jayway/jsonpath/JsonPathTest.java @@ -50,7 +50,8 @@ public class JsonPathTest { " \"color\": \"red\",\n" + " \"price\": 19.95,\n" + " \"foo:bar\": \"fooBar\",\n" + - " \"dot.notation\": \"new\"\n" + + " \"dot.notation\": \"new\",\n" + + " \"dash-notation\": \"dashes\"\n" + " }\n" + " }\n" + "}"; @@ -88,6 +89,13 @@ public class JsonPathTest { assertEquals("new", JsonPath.read(DOCUMENT, "$['store']['bicycle']['dot.notation']")); assertEquals("new", JsonPath.read(DOCUMENT, "$.['store']['bicycle']['dot.notation']")); assertEquals("new", JsonPath.read(DOCUMENT, "$.['store'].['bicycle'].['dot.notation']")); + + System.out.println(ScriptEngineJsonPath.eval(DOCUMENT, "$.store.bicycle.['dash-notation']")); + + assertEquals("dashes", JsonPath.read(DOCUMENT, "$.['store'].bicycle.['dash-notation']")); + assertEquals("dashes", JsonPath.read(DOCUMENT, "$['store']['bicycle']['dash-notation']")); + assertEquals("dashes", JsonPath.read(DOCUMENT, "$.['store']['bicycle']['dash-notation']")); + assertEquals("dashes", JsonPath.read(DOCUMENT, "$.['store'].['bicycle'].['dash-notation']")); } @Test