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

Side by Side Diff: pkg/analyzer/test/generated/utilities_test.dart

Issue 1674963002: Probably don't need an unused re-implementation of addAll(). :) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « pkg/analyzer/lib/src/generated/utilities_collection.dart ('k') | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.test.generated.utilities_test; 5 library analyzer.test.generated.utilities_test;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/src/dart/ast/utilities.dart'; 10 import 'package:analyzer/src/dart/ast/utilities.dart';
(...skipping 12 matching lines...) Expand all
23 import 'test_support.dart'; 23 import 'test_support.dart';
24 24
25 main() { 25 main() {
26 initializeTestEnvironment(); 26 initializeTestEnvironment();
27 runReflectiveTests(AstClonerTest); 27 runReflectiveTests(AstClonerTest);
28 runReflectiveTests(NodeReplacerTest); 28 runReflectiveTests(NodeReplacerTest);
29 runReflectiveTests(LineInfoTest); 29 runReflectiveTests(LineInfoTest);
30 runReflectiveTests(SourceRangeTest); 30 runReflectiveTests(SourceRangeTest);
31 runReflectiveTests(BooleanArrayTest); 31 runReflectiveTests(BooleanArrayTest);
32 runReflectiveTests(DirectedGraphTest); 32 runReflectiveTests(DirectedGraphTest);
33 runReflectiveTests(ListUtilitiesTest);
34 runReflectiveTests(MultipleMapIteratorTest); 33 runReflectiveTests(MultipleMapIteratorTest);
35 runReflectiveTests(SingleMapIteratorTest); 34 runReflectiveTests(SingleMapIteratorTest);
36 runReflectiveTests(TokenMapTest); 35 runReflectiveTests(TokenMapTest);
37 runReflectiveTests(StringUtilitiesTest); 36 runReflectiveTests(StringUtilitiesTest);
38 } 37 }
39 38
40 class AstCloneComparator extends AstComparator { 39 class AstCloneComparator extends AstComparator {
41 final bool expectTokensCopied; 40 final bool expectTokensCopied;
42 41
43 AstCloneComparator(this.expectTokensCopied); 42 AstCloneComparator(this.expectTokensCopied);
(...skipping 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after
2749 2748
2750 class ListGetter_NodeReplacerTest_testSwitchMember_2 2749 class ListGetter_NodeReplacerTest_testSwitchMember_2
2751 extends NodeReplacerTest_ListGetter<SwitchMember, Statement> { 2750 extends NodeReplacerTest_ListGetter<SwitchMember, Statement> {
2752 ListGetter_NodeReplacerTest_testSwitchMember_2(int arg0) : super(arg0); 2751 ListGetter_NodeReplacerTest_testSwitchMember_2(int arg0) : super(arg0);
2753 2752
2754 @override 2753 @override
2755 NodeList<Statement> getList(SwitchMember node) => node.statements; 2754 NodeList<Statement> getList(SwitchMember node) => node.statements;
2756 } 2755 }
2757 2756
2758 @reflectiveTest 2757 @reflectiveTest
2759 class ListUtilitiesTest {
2760 void test_addAll_emptyToEmpty() {
2761 List<String> list = new List<String>();
2762 List<String> elements = <String>[];
2763 ListUtilities.addAll(list, elements);
2764 expect(list.length, 0);
2765 }
2766
2767 void test_addAll_emptyToNonEmpty() {
2768 List<String> list = new List<String>();
2769 list.add("a");
2770 List<String> elements = <String>[];
2771 ListUtilities.addAll(list, elements);
2772 expect(list.length, 1);
2773 }
2774
2775 void test_addAll_nonEmptyToEmpty() {
2776 List<String> list = new List<String>();
2777 List<String> elements = ["b", "c"];
2778 ListUtilities.addAll(list, elements);
2779 expect(list.length, 2);
2780 }
2781
2782 void test_addAll_nonEmptyToNonEmpty() {
2783 List<String> list = new List<String>();
2784 list.add("a");
2785 List<String> elements = ["b", "c"];
2786 ListUtilities.addAll(list, elements);
2787 expect(list.length, 3);
2788 }
2789 }
2790
2791 @reflectiveTest
2792 class MultipleMapIteratorTest extends EngineTestCase { 2758 class MultipleMapIteratorTest extends EngineTestCase {
2793 void test_multipleMaps_firstEmpty() { 2759 void test_multipleMaps_firstEmpty() {
2794 Map<String, String> map1 = new HashMap<String, String>(); 2760 Map<String, String> map1 = new HashMap<String, String>();
2795 Map<String, String> map2 = new HashMap<String, String>(); 2761 Map<String, String> map2 = new HashMap<String, String>();
2796 map2["k2"] = "v2"; 2762 map2["k2"] = "v2";
2797 Map<String, String> map3 = new HashMap<String, String>(); 2763 Map<String, String> map3 = new HashMap<String, String>();
2798 map3["k3"] = "v3"; 2764 map3["k3"] = "v3";
2799 MultipleMapIterator<String, String> iterator = 2765 MultipleMapIterator<String, String> iterator =
2800 _iterator([map1, map2, map3]); 2766 _iterator([map1, map2, map3]);
2801 expect(iterator.moveNext(), isTrue); 2767 expect(iterator.moveNext(), isTrue);
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after
4331 } 4297 }
4332 4298
4333 void test_get_added() { 4299 void test_get_added() {
4334 TokenMap tokenMap = new TokenMap(); 4300 TokenMap tokenMap = new TokenMap();
4335 Token key = TokenFactory.tokenFromType(TokenType.AT); 4301 Token key = TokenFactory.tokenFromType(TokenType.AT);
4336 Token value = TokenFactory.tokenFromType(TokenType.AT); 4302 Token value = TokenFactory.tokenFromType(TokenType.AT);
4337 tokenMap.put(key, value); 4303 tokenMap.put(key, value);
4338 expect(tokenMap.get(key), same(value)); 4304 expect(tokenMap.get(key), same(value));
4339 } 4305 }
4340 } 4306 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/utilities_collection.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698