use of com.alibaba.fastjson.parser.SymbolTable in project fastjson by alibaba.
the class JSONScannerTest_symbol method test_4.
public void test_4() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\/name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick /name" == symbol);
lexer.close();
}
use of com.alibaba.fastjson.parser.SymbolTable in project fastjson by alibaba.
the class JSONScannerTest_symbol method test_10.
public void test_10() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\t name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \t name" == symbol);
lexer.close();
}
use of com.alibaba.fastjson.parser.SymbolTable in project fastjson by alibaba.
the class JSONScannerTest_symbol method test_error_2.
public void test_error_2() throws Exception {
JSONException error = null;
try {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"name");
lexer.scanSymbol(symbolTable, '"');
lexer.close();
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.parser.SymbolTable in project fastjson by alibaba.
the class JSONScannerTest_symbol method test_1.
public void test_1() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick name".equals(symbol));
lexer.close();
}
use of com.alibaba.fastjson.parser.SymbolTable in project fastjson by alibaba.
the class JSONScannerTest_symbol method test_11.
public void test_11() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\u4e2d name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick δΈ name" == symbol);
lexer.close();
}
Aggregations