use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.
the class JSONScannerTest_ident method test_Date.
public void test_Date() throws Exception {
String text = "Date";
JSONScanner lexer = new JSONScanner(text);
lexer.scanIdent();
Assert.assertEquals(JSONToken.IDENTIFIER, lexer.token());
Assert.assertEquals(text, lexer.stringVal());
}
use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.
the class JSONScannerTest_ident method test_null.
public void test_null() throws Exception {
JSONScanner lexer = new JSONScanner("null");
lexer.scanIdent();
Assert.assertEquals(JSONToken.NULL, lexer.token());
}
use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.
the class JSONScannerTest_null method test_scan_false_14.
public void test_scan_false_14() throws Exception {
JSONScanner lexer = new JSONScanner("null}");
lexer.scanNullOrNew();
}
use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.
the class JSONScannerTest_null method test_scan_null_6.
public void test_scan_null_6() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("null\"");
lexer.scanNullOrNew();
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.parser.JSONScanner in project fastjson by alibaba.
the class JSONScannerTest_null method test_scan_null_0.
public void test_scan_null_0() throws Exception {
JSONScanner lexer = new JSONScanner("null");
lexer.scanNullOrNew();
}
Aggregations