Object myRet;
String myJson;
// simple string
myRet = new JSONReader().read(myJson = new JSONWriter().write("blah"));
assertEquals("blah", myRet);
// simple int
myRet = new JSONReader().read(myJson = new JSONWriter().write(1));
assertEquals(1, myRet);
// string with double quotes
myRet = new JSONReader().read(myJson = new JSONWriter().write("t1-blah\"blah"));
assertEquals("t1-blah\"blah", myRet);
// string with single quotes
myRet = new JSONReader().read(myJson = new JSONWriter().write("t2-blah'blah"));
assertEquals("t2-blah'blah", myRet);
// string with two double quotes
myRet = new JSONReader().read(myJson = new JSONWriter().write("t3-blah\"n\"blah"));
assertEquals("t3-blah\"n\"blah", myRet);
// string with two single quotes
myRet = new JSONReader().read(myJson = new JSONWriter().write("t4-blah'n'blah"));
assertEquals("t4-blah'n'blah", myRet);
// string with a single and a double quote
myRet = new JSONReader().read(myJson = new JSONWriter().write("t4-blah'n\"blah"));
assertEquals("t4-blah'n\"blah", myRet);
// UTF-8 character
myRet = new JSONReader().read(myJson = new JSONWriter().write("smile \u9786"));
assertEquals("smile \u9786", myRet);
// null byte
myRet = new JSONReader().read(myJson = new JSONWriter().write("smile \u0000"));
assertEquals("smile \u0000", myRet);
}