| 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.all_the_rest_test; | 5 library analyzer.test.generated.all_the_rest_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/dart/element/type.dart'; | 9 import 'package:analyzer/dart/element/type.dart'; |
| 10 import 'package:analyzer/file_system/physical_file_system.dart'; | 10 import 'package:analyzer/file_system/physical_file_system.dart'; |
| (...skipping 2469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2480 FileBasedSource source3 = new FileBasedSource(file3); | 2480 FileBasedSource source3 = new FileBasedSource(file3); |
| 2481 DirectoryBasedSourceContainer container = | 2481 DirectoryBasedSourceContainer container = |
| 2482 new DirectoryBasedSourceContainer.con1(dir); | 2482 new DirectoryBasedSourceContainer.con1(dir); |
| 2483 expect(container.contains(source1), isTrue); | 2483 expect(container.contains(source1), isTrue); |
| 2484 expect(container.contains(source2), isTrue); | 2484 expect(container.contains(source2), isTrue); |
| 2485 expect(container.contains(source3), isFalse); | 2485 expect(container.contains(source3), isFalse); |
| 2486 } | 2486 } |
| 2487 } | 2487 } |
| 2488 | 2488 |
| 2489 @reflectiveTest | 2489 @reflectiveTest |
| 2490 class ElementBuilderTest extends EngineTestCase { | 2490 class ElementBuilderTest extends ParserTestCase { |
| 2491 void fail_visitMethodDeclaration_setter_duplicate() { |
| 2492 // https://github.com/dart-lang/sdk/issues/25601 |
| 2493 String code = r''' |
| 2494 class C { |
| 2495 set zzz(x) {} |
| 2496 set zzz(y) {} |
| 2497 } |
| 2498 '''; |
| 2499 CompilationUnit unit = ParserTestCase.parseCompilationUnit(code); |
| 2500 ElementHolder holder = new ElementHolder(); |
| 2501 ElementBuilder builder = new ElementBuilder(holder); |
| 2502 unit.accept(builder); |
| 2503 ClassElement classElement = holder.types[0]; |
| 2504 for (PropertyAccessorElement accessor in classElement.accessors) { |
| 2505 expect(accessor.variable.setter, same(accessor)); |
| 2506 } |
| 2507 } |
| 2508 |
| 2491 void test_visitCatchClause() { | 2509 void test_visitCatchClause() { |
| 2492 // } catch (e, s) { | 2510 // } catch (e, s) { |
| 2493 ElementHolder holder = new ElementHolder(); | 2511 ElementHolder holder = new ElementHolder(); |
| 2494 ElementBuilder builder = new ElementBuilder(holder); | 2512 ElementBuilder builder = new ElementBuilder(holder); |
| 2495 String exceptionParameterName = "e"; | 2513 String exceptionParameterName = "e"; |
| 2496 String stackParameterName = "s"; | 2514 String stackParameterName = "s"; |
| 2497 CatchClause clause = | 2515 CatchClause clause = |
| 2498 AstFactory.catchClause2(exceptionParameterName, stackParameterName); | 2516 AstFactory.catchClause2(exceptionParameterName, stackParameterName); |
| 2499 clause.accept(builder); | 2517 clause.accept(builder); |
| 2500 | 2518 |
| (...skipping 3519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6020 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); | 6038 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); |
| 6021 expect(UriKind.fromEncoding(0x58), same(null)); | 6039 expect(UriKind.fromEncoding(0x58), same(null)); |
| 6022 } | 6040 } |
| 6023 | 6041 |
| 6024 void test_getEncoding() { | 6042 void test_getEncoding() { |
| 6025 expect(UriKind.DART_URI.encoding, 0x64); | 6043 expect(UriKind.DART_URI.encoding, 0x64); |
| 6026 expect(UriKind.FILE_URI.encoding, 0x66); | 6044 expect(UriKind.FILE_URI.encoding, 0x66); |
| 6027 expect(UriKind.PACKAGE_URI.encoding, 0x70); | 6045 expect(UriKind.PACKAGE_URI.encoding, 0x70); |
| 6028 } | 6046 } |
| 6029 } | 6047 } |
| OLD | NEW |