OLD | NEW |
(Empty) | |
| 1 library escaping_characters_test; |
| 2 |
| 3 import 'package:unittest/unittest.dart'; |
| 4 |
| 5 void main() { |
| 6 |
| 7 group('escaping characters', () { |
| 8 var name = '''Wile |
| 9 Coyote'''; |
| 10 |
| 11 test('using an escape character', () { |
| 12 expect('Wile\nCoyote', equals('''Wile |
| 13 Coyote''')); |
| 14 }); |
| 15 |
| 16 test('using hex notation', () { |
| 17 expect('Wile\x0ACoyote', equals('''Wile |
| 18 Coyote''')); |
| 19 }); |
| 20 |
| 21 test('using unicode notation', () { |
| 22 expect('Wile\u000ACoyote', equals('''Wile |
| 23 Coyote''')); |
| 24 expect('Wile\u{000A}Coyote', equals('''Wile |
| 25 Coyote''')); |
| 26 }); |
| 27 |
| 28 test('with non-special character', () { |
| 29 expect('Wile \E Coyote', equals('Wile E Coyote')); |
| 30 }); |
| 31 |
| 32 test('with a variable', () { |
| 33 var superGenius = 'Wile Coyote'; |
| 34 expect('\$superGenius', equals(r'$superGenius')); |
| 35 }); |
| 36 }); |
| 37 } |
OLD | NEW |