Skip to content

Commit

Permalink
Add deep nesting unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperjj committed Jul 26, 2016
1 parent 5cef147 commit fcdd9b2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/resources/version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Tue Jul 26 11:57:19 PDT 2016
#Tue Jul 26 12:04:10 PDT 2016
BUILD_VERSION=1.0.0
BUILD_DATE=2016-07-26T18\:57\:19Z
BUILD_NUMBER=26
BUILD_DATE=2016-07-26T19\:04\:10Z
BUILD_NUMBER=28
12 changes: 11 additions & 1 deletion src/test/java/me/doubledutch/lazy/LazyObjectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@
import java.net.*;

public class LazyObjectTest{

@Test
public void testDeepNesting() throws LazyException{
String str="{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":{\"foo\":42}}}}}}}}}}}}}}}}";
LazyObject obj=new LazyObject(str);
for(int i=0;i<15;i++){
obj=obj.getJSONObject("foo");
assertNotNull(obj);
}
assertEquals(42,obj.getInt("foo"));
}

@Test
public void testHas() throws LazyException{
String str="{\"foo\":\"bar\",\"baz\":{\"key\":42}}";
Expand Down

0 comments on commit fcdd9b2

Please sign in to comment.