Skip to content

Commit cbce271

Browse files
authored
Validate string literal generation vs "naughty strings" (#136)
1 parent 647c529 commit cbce271

File tree

4 files changed

+1034
-0
lines changed

4 files changed

+1034
-0
lines changed

json_serializable/test/json_literal_test.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,15 @@ main() {
2525

2626
expect(dartString, dataString);
2727
});
28+
29+
test('naughty strings', () {
30+
var dataFilePath = p.join(getPackagePath(), 'test', 'test_files',
31+
'big-list-of-naughty-strings.json');
32+
var dataFile = new File(dataFilePath);
33+
34+
var dataString = loudEncode(json.decode(dataFile.readAsStringSync()));
35+
var dartString = loudEncode(naughtyStrings);
36+
37+
expect(dartString, dataString);
38+
});
2839
}

0 commit comments

Comments
 (0)