| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 barback.test.multiset_test; | 5 library barback.test.multiset_test; |
| 6 | 6 |
| 7 import 'package:barback/src/utils/multiset.dart'; | 7 import 'package:barback/src/multiset.dart'; |
| 8 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
| 9 | 9 |
| 10 import 'utils.dart'; | 10 import 'utils.dart'; |
| 11 | 11 |
| 12 main() { | 12 main() { |
| 13 initConfig(); | 13 initConfig(); |
| 14 | 14 |
| 15 test("new Multiset() creates an empty set", () { | 15 test("new Multiset() creates an empty set", () { |
| 16 var multiSet = new Multiset(); | 16 var multiSet = new Multiset(); |
| 17 expect(multiSet, isEmpty); | 17 expect(multiSet, isEmpty); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 test("iterator orders distinct elements in insertion order", () { | 70 test("iterator orders distinct elements in insertion order", () { |
| 71 var multiSet = new Multiset()..add(1)..add(2)..add(3)..add(4)..add(5); | 71 var multiSet = new Multiset()..add(1)..add(2)..add(3)..add(4)..add(5); |
| 72 expect(multiSet.toList(), equals([1, 2, 3, 4, 5])); | 72 expect(multiSet.toList(), equals([1, 2, 3, 4, 5])); |
| 73 }); | 73 }); |
| 74 | 74 |
| 75 test("iterator groups multiple copies of an element together", () { | 75 test("iterator groups multiple copies of an element together", () { |
| 76 var multiSet = new Multiset()..add(1)..add(2)..add(1)..add(2)..add(1); | 76 var multiSet = new Multiset()..add(1)..add(2)..add(1)..add(2)..add(1); |
| 77 expect(multiSet.toList(), equals([1, 1, 1, 2, 2])); | 77 expect(multiSet.toList(), equals([1, 1, 1, 2, 2])); |
| 78 }); | 78 }); |
| 79 } | 79 } |
| OLD | NEW |