Browse Source

Add test case for fixing parsing logic for function with no arguments

Add test case for fixing parsing logic for function with no arguments
pull/990/head
abhishek kumar tiwari 1 year ago committed by GitHub
parent
commit
50d0ff29d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      json-path/src/test/java/com/jayway/jsonpath/PathCompilerTest.java

7
json-path/src/test/java/com/jayway/jsonpath/PathCompilerTest.java

@ -323,4 +323,11 @@ public class PathCompilerTest {
public void property_must_be_separated_by_commas() {
compile("$['aaa'}'bbb']");
}
@Test
public void function_with_no_argument_can_be_parsed() {
String json = "{\"empty\": [], \"number-series\" : [[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [11, 12]]}";
Integer result = JsonPath.read(json, "$.number-series.first().last()");
assertThat(result).isEqualTo(10);
}
}

Loading…
Cancel
Save