Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: recipes/test/core/strings/escaping_characters_test.dart

Issue 12335109: Strings recipes for the Dart Cookbook (Closed) Base URL: https://github.com/dart-lang/cookbook.git@master
Patch Set: Made most changes requested my Kathy. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698