stleary / JSON-Java-unit-test

Junit test harness to validate the JSON-Java GitHub project code.
Apache License 2.0
28 stars 45 forks source link

Tests for JSON Pointers #46

Closed erosb closed 8 years ago

erosb commented 8 years ago

Tests for this PR: https://github.com/stleary/JSON-java/pull/222

stleary commented 8 years ago

Sorry, will be some delay, having problems getting coverage to work in my dev environment.

stleary commented 8 years ago

Thank goodness for dev environments on multiple boxes. Coverage is fine, thanks for taking the time to do these tests. You may, if you want, add testing for JSONObject.query() and JSONArray.query(), otherwise I can add them. JunitTestSuite.java should have JSONPointer.class added to the SuiteClasses annotation. Otherwise all looks OK so far.

johnjaylward commented 8 years ago

Maybe just add a test for this:

Builder b = JSONPointer.builder().append("key1");
JSONPointer jp1 = b.build();
b.append("key2");
JSONPointer jp2 = b.build();
if(jp1.toString().equals(jp2.toString()){
    throw new Exception("Oops, my pointers are sharing a backing array");
}