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

Side by Side Diff: test/transcript_test.dart

Issue 1215833002: Use the new test runner. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 5 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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library version_test; 5 library version_test;
6 6
7 import 'package:pub/src/transcript.dart'; 7 import 'package:pub/src/transcript.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:test/test.dart';
9 9
10 import 'test_pub.dart'; 10 import 'test_pub.dart';
11 11
12 main() { 12 main() {
13 initConfig();
14
15 test("discards from the middle once it reaches the maximum", () { 13 test("discards from the middle once it reaches the maximum", () {
16 var transcript = new Transcript<String>(4); 14 var transcript = new Transcript<String>(4);
17 forEachToString() { 15 forEachToString() {
18 var result = ""; 16 var result = "";
19 transcript.forEach((entry) => result += entry, (n) => result += "[$n]"); 17 transcript.forEach((entry) => result += entry, (n) => result += "[$n]");
20 return result; 18 return result;
21 } 19 }
22 20
23 expect(forEachToString(), equals("")); 21 expect(forEachToString(), equals(""));
24 transcript.add("a"); 22 transcript.add("a");
(...skipping 27 matching lines...) Expand all
52 expect(forEachToString(), equals("abc")); 50 expect(forEachToString(), equals("abc"));
53 transcript.add("d"); 51 transcript.add("d");
54 expect(forEachToString(), equals("abcd")); 52 expect(forEachToString(), equals("abcd"));
55 transcript.add("e"); 53 transcript.add("e");
56 expect(forEachToString(), equals("abcde")); 54 expect(forEachToString(), equals("abcde"));
57 transcript.add("f"); 55 transcript.add("f");
58 expect(forEachToString(), equals("abcdef")); 56 expect(forEachToString(), equals("abcdef"));
59 }); 57 });
60 58
61 } 59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698