| OLD | NEW |
| 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.sdk_test; | 5 library analyzer.test.generated.sdk_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/engine.dart'; | 7 import 'package:analyzer/src/generated/engine.dart'; |
| 8 import 'package:analyzer/src/generated/sdk.dart'; | 8 import 'package:analyzer/src/generated/sdk.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 DartSdk result = manager.getSdk(description, () => sdk); | 59 DartSdk result = manager.getSdk(description, () => sdk); |
| 60 expect(result, same(sdk)); | 60 expect(result, same(sdk)); |
| 61 manager.getSdk(description, _failIfAbsent); | 61 manager.getSdk(description, _failIfAbsent); |
| 62 } | 62 } |
| 63 | 63 |
| 64 DartSdk _failIfAbsent() { | 64 DartSdk _failIfAbsent() { |
| 65 fail('Use of ifAbsent function'); | 65 fail('Use of ifAbsent function'); |
| 66 return null; | 66 return null; |
| 67 } | 67 } |
| 68 | 68 |
| 69 DartSdk _failIfCreated(_) { | 69 DartSdk _failIfCreated(AnalysisOptions _) { |
| 70 fail('Use of sdkCreator'); | 70 fail('Use of sdkCreator'); |
| 71 return null; | 71 return null; |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 @reflectiveTest | 75 @reflectiveTest |
| 76 class SdkDescriptionTest extends EngineTestCase { | 76 class SdkDescriptionTest extends EngineTestCase { |
| 77 void test_equals_differentPaths_nested() { | 77 void test_equals_differentPaths_nested() { |
| 78 AnalysisOptions options = new AnalysisOptionsImpl(); | 78 AnalysisOptions options = new AnalysisOptionsImpl(); |
| 79 SdkDescription left = new SdkDescription(<String>['/a/b/c'], options); | 79 SdkDescription left = new SdkDescription(<String>['/a/b/c'], options); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 | 118 |
| 119 void test_equals_samePaths_sameOptions_single() { | 119 void test_equals_samePaths_sameOptions_single() { |
| 120 String path = '/a/b/c'; | 120 String path = '/a/b/c'; |
| 121 AnalysisOptions options = new AnalysisOptionsImpl(); | 121 AnalysisOptions options = new AnalysisOptionsImpl(); |
| 122 SdkDescription left = new SdkDescription(<String>[path], options); | 122 SdkDescription left = new SdkDescription(<String>[path], options); |
| 123 SdkDescription right = new SdkDescription(<String>[path], options); | 123 SdkDescription right = new SdkDescription(<String>[path], options); |
| 124 expect(left == right, isTrue); | 124 expect(left == right, isTrue); |
| 125 } | 125 } |
| 126 } | 126 } |
| OLD | NEW |