Index: recipes/test/core/strings/escaping_characters_test.dart |
diff --git a/recipes/test/core/strings/escaping_characters_test.dart b/recipes/test/core/strings/escaping_characters_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5a334a00c2681aef82a79d151ad1d331341b4483 |
--- /dev/null |
+++ b/recipes/test/core/strings/escaping_characters_test.dart |
@@ -0,0 +1,37 @@ |
+library escaping_characters_test; |
+ |
+import 'package:unittest/unittest.dart'; |
+ |
+void main() { |
+ |
+ group('escaping characters', () { |
+ var name = '''Wile |
+Coyote'''; |
+ |
+ test('using an escape character', () { |
+ expect('Wile\nCoyote', equals('''Wile |
+Coyote''')); |
+ }); |
+ |
+ test('using hex notation', () { |
+ expect('Wile\x0ACoyote', equals('''Wile |
+Coyote''')); |
+ }); |
+ |
+ test('using unicode notation', () { |
+ expect('Wile\u000ACoyote', equals('''Wile |
+Coyote''')); |
+ expect('Wile\u{000A}Coyote', equals('''Wile |
+Coyote''')); |
+ }); |
+ |
+ test('with non-special character', () { |
+ expect('Wile \E Coyote', equals('Wile E Coyote')); |
+ }); |
+ |
+ test('with a variable', () { |
+ var superGenius = 'Wile Coyote'; |
+ expect('\$superGenius', equals(r'$superGenius')); |
+ }); |
+ }); |
+} |