| OLD | NEW |
| 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:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
| 9 |
| 8 import 'test_pub.dart'; | 10 import 'test_pub.dart'; |
| 9 import '../lib/src/transcript.dart'; | |
| 10 | 11 |
| 11 main() { | 12 main() { |
| 12 initConfig(); | 13 initConfig(); |
| 13 | 14 |
| 14 test("discards from the middle once it reaches the maximum", () { | 15 test("discards from the middle once it reaches the maximum", () { |
| 15 var transcript = new Transcript<String>(4); | 16 var transcript = new Transcript<String>(4); |
| 16 forEachToString() { | 17 forEachToString() { |
| 17 var result = ""; | 18 var result = ""; |
| 18 transcript.forEach((entry) => result += entry, (n) => result += "[$n]"); | 19 transcript.forEach((entry) => result += entry, (n) => result += "[$n]"); |
| 19 return result; | 20 return result; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 expect(forEachToString(), equals("abc")); | 52 expect(forEachToString(), equals("abc")); |
| 52 transcript.add("d"); | 53 transcript.add("d"); |
| 53 expect(forEachToString(), equals("abcd")); | 54 expect(forEachToString(), equals("abcd")); |
| 54 transcript.add("e"); | 55 transcript.add("e"); |
| 55 expect(forEachToString(), equals("abcde")); | 56 expect(forEachToString(), equals("abcde")); |
| 56 transcript.add("f"); | 57 transcript.add("f"); |
| 57 expect(forEachToString(), equals("abcdef")); | 58 expect(forEachToString(), equals("abcdef")); |
| 58 }); | 59 }); |
| 59 | 60 |
| 60 } | 61 } |
| OLD | NEW |