-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the issue 629 and add two testcases (#698)
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
json-path/src/test/java/com/jayway/jsonpath/internal/function/Issue629.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.jayway.jsonpath.internal.function; | ||
|
||
import com.jayway.jsonpath.JsonPath; | ||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
public class Issue629 { | ||
@Test | ||
public void testUncloseParenthesis() throws IOException { | ||
try { | ||
JsonPath jsonPath = JsonPath.compile("$.A.B.C.D("); | ||
assert(false); | ||
} | ||
catch (Exception e) { | ||
assertTrue(e.getMessage().startsWith("Arguments to function:")); | ||
} | ||
} | ||
|
||
@Test | ||
public void testUncloseParenthesisWithNestedCall() throws IOException { | ||
try { | ||
JsonPath jsonPath = JsonPath.compile("$.A.B.C.sum(D()"); | ||
assert(false); | ||
} | ||
catch (Exception e) { | ||
assertTrue(e.getMessage().startsWith("Arguments to function:")); | ||
} | ||
} | ||
} |