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

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

Issue 673233003: Replace custom EngineTestCase.assertEquals() with 'unorderedEquals'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/engine_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) 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.element_test; 8 library engine.element_test;
9 9
10 import 'package:analyzer/src/generated/java_core.dart'; 10 import 'package:analyzer/src/generated/java_core.dart';
(...skipping 2972 matching lines...) Expand 10 before | Expand all | Expand 10 after
2983 PrefixElement prefixB = new PrefixElementImpl.forNode(AstFactory.identifier3 ("b")); 2983 PrefixElement prefixB = new PrefixElementImpl.forNode(AstFactory.identifier3 ("b"));
2984 List<ImportElementImpl> imports = [ 2984 List<ImportElementImpl> imports = [
2985 ElementFactory.importFor(library2, null, []), 2985 ElementFactory.importFor(library2, null, []),
2986 ElementFactory.importFor(library2, prefixB, []), 2986 ElementFactory.importFor(library2, prefixB, []),
2987 ElementFactory.importFor(library3, null, []), 2987 ElementFactory.importFor(library3, null, []),
2988 ElementFactory.importFor(library3, prefixA, []), 2988 ElementFactory.importFor(library3, prefixA, []),
2989 ElementFactory.importFor(library3, prefixB, []), 2989 ElementFactory.importFor(library3, prefixB, []),
2990 ElementFactory.importFor(library4, prefixA, [])]; 2990 ElementFactory.importFor(library4, prefixA, [])];
2991 library1.imports = imports; 2991 library1.imports = imports;
2992 List<LibraryElement> libraries = library1.importedLibraries; 2992 List<LibraryElement> libraries = library1.importedLibraries;
2993 EngineTestCase.assertEqualsIgnoreOrder(<LibraryElement> [library2, library3, library4], libraries); 2993 expect(libraries, unorderedEquals(<LibraryElement> [library2, library3, libr ary4]));
2994 } 2994 }
2995 2995
2996 void test_getPrefixes() { 2996 void test_getPrefixes() {
2997 AnalysisContext context = createAnalysisContext(); 2997 AnalysisContext context = createAnalysisContext();
2998 LibraryElementImpl library = ElementFactory.library(context, "l1"); 2998 LibraryElementImpl library = ElementFactory.library(context, "l1");
2999 PrefixElement prefixA = new PrefixElementImpl.forNode(AstFactory.identifier3 ("a")); 2999 PrefixElement prefixA = new PrefixElementImpl.forNode(AstFactory.identifier3 ("a"));
3000 PrefixElement prefixB = new PrefixElementImpl.forNode(AstFactory.identifier3 ("b")); 3000 PrefixElement prefixB = new PrefixElementImpl.forNode(AstFactory.identifier3 ("b"));
3001 List<ImportElementImpl> imports = [ 3001 List<ImportElementImpl> imports = [
3002 ElementFactory.importFor(ElementFactory.library(context, "l2"), null, [] ), 3002 ElementFactory.importFor(ElementFactory.library(context, "l2"), null, [] ),
3003 ElementFactory.importFor(ElementFactory.library(context, "l3"), null, [] ), 3003 ElementFactory.importFor(ElementFactory.library(context, "l3"), null, [] ),
(...skipping 11 matching lines...) Expand all
3015 } 3015 }
3016 } 3016 }
3017 3017
3018 void test_getUnits() { 3018 void test_getUnits() {
3019 AnalysisContext context = createAnalysisContext(); 3019 AnalysisContext context = createAnalysisContext();
3020 LibraryElementImpl library = ElementFactory.library(context, "test"); 3020 LibraryElementImpl library = ElementFactory.library(context, "test");
3021 CompilationUnitElement unitLib = library.definingCompilationUnit; 3021 CompilationUnitElement unitLib = library.definingCompilationUnit;
3022 CompilationUnitElementImpl unitA = ElementFactory.compilationUnit("unit_a.da rt"); 3022 CompilationUnitElementImpl unitA = ElementFactory.compilationUnit("unit_a.da rt");
3023 CompilationUnitElementImpl unitB = ElementFactory.compilationUnit("unit_b.da rt"); 3023 CompilationUnitElementImpl unitB = ElementFactory.compilationUnit("unit_b.da rt");
3024 library.parts = <CompilationUnitElement> [unitA, unitB]; 3024 library.parts = <CompilationUnitElement> [unitA, unitB];
3025 EngineTestCase.assertEqualsIgnoreOrder(<CompilationUnitElement> [unitLib, un itA, unitB], library.units); 3025 expect(library.units, unorderedEquals(<CompilationUnitElement> [unitLib, uni tA, unitB]));
3026 } 3026 }
3027 3027
3028 void test_getVisibleLibraries_cycle() { 3028 void test_getVisibleLibraries_cycle() {
3029 AnalysisContext context = createAnalysisContext(); 3029 AnalysisContext context = createAnalysisContext();
3030 LibraryElementImpl library = ElementFactory.library(context, "app"); 3030 LibraryElementImpl library = ElementFactory.library(context, "app");
3031 LibraryElementImpl libraryA = ElementFactory.library(context, "A"); 3031 LibraryElementImpl libraryA = ElementFactory.library(context, "A");
3032 libraryA.imports = <ImportElementImpl> [ElementFactory.importFor(library, nu ll, [])]; 3032 libraryA.imports = <ImportElementImpl> [ElementFactory.importFor(library, nu ll, [])];
3033 library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, nu ll, [])]; 3033 library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, nu ll, [])];
3034 List<LibraryElement> libraries = library.visibleLibraries; 3034 List<LibraryElement> libraries = library.visibleLibraries;
3035 EngineTestCase.assertEqualsIgnoreOrder(<LibraryElement> [library, libraryA], libraries); 3035 expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA]));
3036 } 3036 }
3037 3037
3038 void test_getVisibleLibraries_directExports() { 3038 void test_getVisibleLibraries_directExports() {
3039 AnalysisContext context = createAnalysisContext(); 3039 AnalysisContext context = createAnalysisContext();
3040 LibraryElementImpl library = ElementFactory.library(context, "app"); 3040 LibraryElementImpl library = ElementFactory.library(context, "app");
3041 LibraryElementImpl libraryA = ElementFactory.library(context, "A"); 3041 LibraryElementImpl libraryA = ElementFactory.library(context, "A");
3042 library.exports = <ExportElementImpl> [ElementFactory.exportFor(libraryA, [] )]; 3042 library.exports = <ExportElementImpl> [ElementFactory.exportFor(libraryA, [] )];
3043 List<LibraryElement> libraries = library.visibleLibraries; 3043 List<LibraryElement> libraries = library.visibleLibraries;
3044 EngineTestCase.assertEqualsIgnoreOrder(<LibraryElement> [library], libraries ); 3044 expect(libraries, unorderedEquals(<LibraryElement> [library]));
3045 } 3045 }
3046 3046
3047 void test_getVisibleLibraries_directImports() { 3047 void test_getVisibleLibraries_directImports() {
3048 AnalysisContext context = createAnalysisContext(); 3048 AnalysisContext context = createAnalysisContext();
3049 LibraryElementImpl library = ElementFactory.library(context, "app"); 3049 LibraryElementImpl library = ElementFactory.library(context, "app");
3050 LibraryElementImpl libraryA = ElementFactory.library(context, "A"); 3050 LibraryElementImpl libraryA = ElementFactory.library(context, "A");
3051 library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, nu ll, [])]; 3051 library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, nu ll, [])];
3052 List<LibraryElement> libraries = library.visibleLibraries; 3052 List<LibraryElement> libraries = library.visibleLibraries;
3053 EngineTestCase.assertEqualsIgnoreOrder(<LibraryElement> [library, libraryA], libraries); 3053 expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA]));
3054 } 3054 }
3055 3055
3056 void test_getVisibleLibraries_indirectExports() { 3056 void test_getVisibleLibraries_indirectExports() {
3057 AnalysisContext context = createAnalysisContext(); 3057 AnalysisContext context = createAnalysisContext();
3058 LibraryElementImpl library = ElementFactory.library(context, "app"); 3058 LibraryElementImpl library = ElementFactory.library(context, "app");
3059 LibraryElementImpl libraryA = ElementFactory.library(context, "A"); 3059 LibraryElementImpl libraryA = ElementFactory.library(context, "A");
3060 LibraryElementImpl libraryAA = ElementFactory.library(context, "AA"); 3060 LibraryElementImpl libraryAA = ElementFactory.library(context, "AA");
3061 libraryA.exports = <ExportElementImpl> [ElementFactory.exportFor(libraryAA, [])]; 3061 libraryA.exports = <ExportElementImpl> [ElementFactory.exportFor(libraryAA, [])];
3062 library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, nu ll, [])]; 3062 library.imports = <ImportElementImpl> [ElementFactory.importFor(libraryA, nu ll, [])];
3063 List<LibraryElement> libraries = library.visibleLibraries; 3063 List<LibraryElement> libraries = library.visibleLibraries;
3064 EngineTestCase.assertEqualsIgnoreOrder(<LibraryElement> [library, libraryA, libraryAA], libraries); 3064 expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA, libra ryAA]));
3065 } 3065 }
3066 3066
3067 void test_getVisibleLibraries_indirectImports() { 3067 void test_getVisibleLibraries_indirectImports() {
3068 AnalysisContext context = createAnalysisContext(); 3068 AnalysisContext context = createAnalysisContext();
3069 LibraryElementImpl library = ElementFactory.library(context, "app"); 3069 LibraryElementImpl library = ElementFactory.library(context, "app");
3070 LibraryElementImpl libraryA = ElementFactory.library(context, "A"); 3070 LibraryElementImpl libraryA = ElementFactory.library(context, "A");
3071 LibraryElementImpl libraryAA = ElementFactory.library(context, "AA"); 3071 LibraryElementImpl libraryAA = ElementFactory.library(context, "AA");
3072 LibraryElementImpl libraryB = ElementFactory.library(context, "B"); 3072 LibraryElementImpl libraryB = ElementFactory.library(context, "B");
3073 libraryA.imports = <ImportElementImpl> [ElementFactory.importFor(libraryAA, null, [])]; 3073 libraryA.imports = <ImportElementImpl> [ElementFactory.importFor(libraryAA, null, [])];
3074 library.imports = <ImportElementImpl> [ 3074 library.imports = <ImportElementImpl> [
3075 ElementFactory.importFor(libraryA, null, []), 3075 ElementFactory.importFor(libraryA, null, []),
3076 ElementFactory.importFor(libraryB, null, [])]; 3076 ElementFactory.importFor(libraryB, null, [])];
3077 List<LibraryElement> libraries = library.visibleLibraries; 3077 List<LibraryElement> libraries = library.visibleLibraries;
3078 EngineTestCase.assertEqualsIgnoreOrder(<LibraryElement> [library, libraryA, libraryAA, libraryB], libraries); 3078 expect(libraries, unorderedEquals(<LibraryElement> [library, libraryA, libra ryAA, libraryB]));
3079 } 3079 }
3080 3080
3081 void test_getVisibleLibraries_noImports() { 3081 void test_getVisibleLibraries_noImports() {
3082 AnalysisContext context = createAnalysisContext(); 3082 AnalysisContext context = createAnalysisContext();
3083 LibraryElementImpl library = ElementFactory.library(context, "app"); 3083 LibraryElementImpl library = ElementFactory.library(context, "app");
3084 EngineTestCase.assertEqualsIgnoreOrder(<LibraryElement> [library], library.v isibleLibraries); 3084 expect(library.visibleLibraries, unorderedEquals(<LibraryElement> [library]) );
3085 } 3085 }
3086 3086
3087 void test_isUpToDate() { 3087 void test_isUpToDate() {
3088 AnalysisContext context = createAnalysisContext(); 3088 AnalysisContext context = createAnalysisContext();
3089 context.sourceFactory = new SourceFactory([]); 3089 context.sourceFactory = new SourceFactory([]);
3090 LibraryElement library = ElementFactory.library(context, "foo"); 3090 LibraryElement library = ElementFactory.library(context, "foo");
3091 context.setContents(library.definingCompilationUnit.source, "sdfsdff"); 3091 context.setContents(library.definingCompilationUnit.source, "sdfsdff");
3092 // Assert that we are not up to date if the target has an old time stamp. 3092 // Assert that we are not up to date if the target has an old time stamp.
3093 expect(library.isUpToDate(0), isFalse); 3093 expect(library.isUpToDate(0), isFalse);
3094 // Assert that we are up to date with a target modification time in the futu re. 3094 // Assert that we are up to date with a target modification time in the futu re.
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
3479 runReflectiveTests(UnionTypeImplTest); 3479 runReflectiveTests(UnionTypeImplTest);
3480 runReflectiveTests(VoidTypeImplTest); 3480 runReflectiveTests(VoidTypeImplTest);
3481 runReflectiveTests(ClassElementImplTest); 3481 runReflectiveTests(ClassElementImplTest);
3482 runReflectiveTests(CompilationUnitElementImplTest); 3482 runReflectiveTests(CompilationUnitElementImplTest);
3483 runReflectiveTests(ElementLocationImplTest); 3483 runReflectiveTests(ElementLocationImplTest);
3484 runReflectiveTests(ElementImplTest); 3484 runReflectiveTests(ElementImplTest);
3485 runReflectiveTests(HtmlElementImplTest); 3485 runReflectiveTests(HtmlElementImplTest);
3486 runReflectiveTests(LibraryElementImplTest); 3486 runReflectiveTests(LibraryElementImplTest);
3487 runReflectiveTests(MultiplyDefinedElementImplTest); 3487 runReflectiveTests(MultiplyDefinedElementImplTest);
3488 } 3488 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698