use of com.alibaba.fastjson.parser.SymbolTable in project fastjson by alibaba.
the class JSONScannerTest_symbol method test_error.
public void test_error() throws Exception {
JSONException error = null;
try {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\a 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_6.
public void test_6() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\f name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \f name" == symbol);
lexer.close();
}
use of com.alibaba.fastjson.parser.SymbolTable in project fastjson by alibaba.
the class JSONScannerTest_symbol method test_2.
public void test_2() 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_5.
public void test_5() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\bname\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \bname" == symbol);
lexer.close();
}
use of com.alibaba.fastjson.parser.SymbolTable in project fastjson by alibaba.
the class JSONScannerTest_symbol method test_8.
public void test_8() throws Exception {
SymbolTable symbolTable = new SymbolTable(512);
JSONScanner lexer = new JSONScanner("\"nick \\n name\"");
String symbol = lexer.scanSymbol(symbolTable, '"');
Assert.assertTrue("nick \n name" == symbol);
lexer.close();
}
Aggregations