bug fixed for mysql parser.

This commit is contained in:
wenshao
2018-01-17 21:26:39 +08:00
parent c39f787c10
commit f50c14d9ea
15 changed files with 277 additions and 26 deletions
@@ -31,10 +31,10 @@ public class Bug_for_ruiyi extends TestCase {
+ "\\\"title\\\":\\\"Please contact your card issuer to double confirm.\\\","
+ "\\\"type\\\":\\\"END\\\"," + "\\\"currentLevel\\\":3}]}]}\",607)";
String expected = "INSERT INTO icshall_guide (id, gmt_create, gmt_modified, subject, content"
+ "\n\t, cat_id)"
+ "\nVALUES (8, now(), now(), \"Why my payment is deducted incorrectly?/ Why my payment is deducted twice?\", '{\"id\":1,\"title\":\"Have you contacted your card issuer to double check instead of only checking online?\",\"type\":\"START\",\"currentLevel\":1,\"name\":\"name1\",\"values\":[{\"id\":2,\"title\":\"Yes\",\"type\":\"MIDWAY\",\"currentLevel\":2,\"value\":1,\"childs\":[{\"id\":3,\"title\":\"If it is deducted twice, please contact the online service with the official bank statement.\",\"type\":\"END\",\"currentLevel\":3}]},{\"id\":4,\"title\":\"No\",\"type\":\"MIDWAY\",\"currentLevel\":2,\"value\":1,\"childs\":[{\"id\":5,\"title\":\"Please contact your card issuer to double confirm.\",\"type\":\"END\",\"currentLevel\":3}]}]}'"
+ "\n\t, 607);\n";
String expected = "INSERT INTO icshall_guide (id, gmt_create, gmt_modified, subject, content\n" +
"\t, cat_id)\n" +
"VALUES (8, now(), now(), 'Why my payment is deducted incorrectly?/ Why my payment is deducted twice?', '{\"id\":1,\"title\":\"Have you contacted your card issuer to double check instead of only checking online?\",\"type\":\"START\",\"currentLevel\":1,\"name\":\"name1\",\"values\":[{\"id\":2,\"title\":\"Yes\",\"type\":\"MIDWAY\",\"currentLevel\":2,\"value\":1,\"childs\":[{\"id\":3,\"title\":\"If it is deducted twice, please contact the online service with the official bank statement.\",\"type\":\"END\",\"currentLevel\":3}]},{\"id\":4,\"title\":\"No\",\"type\":\"MIDWAY\",\"currentLevel\":2,\"value\":1,\"childs\":[{\"id\":5,\"title\":\"Please contact your card issuer to double confirm.\",\"type\":\"END\",\"currentLevel\":3}]}]}'\n" +
"\t, 607);\n";
StringBuilder out = new StringBuilder();
MySqlOutputVisitor visitor = new MySqlOutputVisitor(out);