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

Side by Side Diff: test/transcript_test.dart

Issue 1556243002: Fix analyzer hints and warnings in test/. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « test/test_pub.dart ('k') | test/transformer/cache_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:test/test.dart'; 8 import 'package:test/test.dart';
9 9
10 import 'test_pub.dart';
11
12 main() { 10 main() {
13 test("discards from the middle once it reaches the maximum", () { 11 test("discards from the middle once it reaches the maximum", () {
14 var transcript = new Transcript<String>(4); 12 var transcript = new Transcript<String>(4);
15 forEachToString() { 13 forEachToString() {
16 var result = ""; 14 var result = "";
17 transcript.forEach((entry) => result += entry, (n) => result += "[$n]"); 15 transcript.forEach((entry) => result += entry, (n) => result += "[$n]");
18 return result; 16 return result;
19 } 17 }
20 18
21 expect(forEachToString(), equals("")); 19 expect(forEachToString(), equals(""));
(...skipping 28 matching lines...) Expand all
50 expect(forEachToString(), equals("abc")); 48 expect(forEachToString(), equals("abc"));
51 transcript.add("d"); 49 transcript.add("d");
52 expect(forEachToString(), equals("abcd")); 50 expect(forEachToString(), equals("abcd"));
53 transcript.add("e"); 51 transcript.add("e");
54 expect(forEachToString(), equals("abcde")); 52 expect(forEachToString(), equals("abcde"));
55 transcript.add("f"); 53 transcript.add("f");
56 expect(forEachToString(), equals("abcdef")); 54 expect(forEachToString(), equals("abcdef"));
57 }); 55 });
58 56
59 } 57 }
OLDNEW
« no previous file with comments | « test/test_pub.dart ('k') | test/transformer/cache_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698