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

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

Issue 12335109: Strings recipes for the Dart Cookbook (Closed) Base URL: https://github.com/dart-lang/cookbook.git@master
Patch Set: Numerous minor changes based on reviewers' comments. 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 incrementally_building;
2
3 import 'package:unittest/unittest.dart';
4
5 void main() {
6 group('incrementally building a string using a StringBuffer', () {
7 test('using write()', () {
8 var sb = new StringBuffer();
9 sb.write('John, ');
10 sb.write('Paul, ');
11 sb.write('George, ');
12 sb.write('and Ringo');
13 expect(sb.toString(), equals('John, Paul, George, and Ringo'));
14 });
15
16 test('using several methods', () {
17 var sb = new StringBuffer();
18 sb.writeln('The Beatles:');
19 sb.writeAll(['John, ', 'Paul, ', 'George, and Ringo']);
20 sb.writeCharCode(33); // charCode for '!'.
21 expect(sb.toString(), equals('The Beatles:\nJohn, Paul, George, and Ringo! '));
22 });
23 });
24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698