| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 test.src.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/constant/value.dart'; | 10 import 'package:analyzer/dart/constant/value.dart'; |
| (...skipping 2514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2525 | 2525 |
| 2526 test_constExpr_pushReference_staticMethod_simpleIdentifier() { | 2526 test_constExpr_pushReference_staticMethod_simpleIdentifier() { |
| 2527 checkLibrary(''' | 2527 checkLibrary(''' |
| 2528 class C { | 2528 class C { |
| 2529 static const a = m; | 2529 static const a = m; |
| 2530 static m() {} | 2530 static m() {} |
| 2531 } | 2531 } |
| 2532 '''); | 2532 '''); |
| 2533 } | 2533 } |
| 2534 | 2534 |
| 2535 test_constructor_default_refers_to_generic_class() { | |
| 2536 checkLibrary(''' | |
| 2537 class B<T> { | |
| 2538 const B(); | |
| 2539 } | |
| 2540 class C<T> { | |
| 2541 const C([B<T> b = const B()]); | |
| 2542 } | |
| 2543 '''); | |
| 2544 } | |
| 2545 | |
| 2546 test_constructor_default_refers_to_generic_class2() { | |
| 2547 checkLibrary(''' | |
| 2548 abstract class A<T> {} | |
| 2549 class B<T> implements A<T> { | |
| 2550 const B(); | |
| 2551 } | |
| 2552 class C<T> implements A<Iterable<T>> { | |
| 2553 const C([A<T> a = const B()]); | |
| 2554 } | |
| 2555 '''); | |
| 2556 } | |
| 2557 | |
| 2558 test_constructor_documented() { | 2535 test_constructor_documented() { |
| 2559 checkLibrary(''' | 2536 checkLibrary(''' |
| 2560 class C { | 2537 class C { |
| 2561 /** | 2538 /** |
| 2562 * Docs | 2539 * Docs |
| 2563 */ | 2540 */ |
| 2564 C(); | 2541 C(); |
| 2565 }'''); | 2542 }'''); |
| 2566 } | 2543 } |
| 2567 | 2544 |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2903 final x; | 2880 final x; |
| 2904 C() : x = new D(); | 2881 C() : x = new D(); |
| 2905 } | 2882 } |
| 2906 class D { | 2883 class D { |
| 2907 final x; | 2884 final x; |
| 2908 D() : x = new C(); | 2885 D() : x = new C(); |
| 2909 } | 2886 } |
| 2910 '''); | 2887 '''); |
| 2911 } | 2888 } |
| 2912 | 2889 |
| 2890 test_defaultValue_refersToGenericClass_constructor() { |
| 2891 checkLibrary(''' |
| 2892 class B<T> { |
| 2893 const B(); |
| 2894 } |
| 2895 class C<T> { |
| 2896 const C([B<T> b = const B()]); |
| 2897 } |
| 2898 '''); |
| 2899 } |
| 2900 |
| 2901 test_defaultValue_refersToGenericClass_constructor2() { |
| 2902 checkLibrary(''' |
| 2903 abstract class A<T> {} |
| 2904 class B<T> implements A<T> { |
| 2905 const B(); |
| 2906 } |
| 2907 class C<T> implements A<Iterable<T>> { |
| 2908 const C([A<T> a = const B()]); |
| 2909 } |
| 2910 '''); |
| 2911 } |
| 2912 |
| 2913 test_defaultValue_refersToGenericClass_functionG() { |
| 2914 checkLibrary(''' |
| 2915 class B<T> { |
| 2916 const B(); |
| 2917 } |
| 2918 void foo<T>([B<T> b = const B()]) {} |
| 2919 '''); |
| 2920 } |
| 2921 |
| 2922 test_defaultValue_refersToGenericClass_methodG() { |
| 2923 checkLibrary(''' |
| 2924 class B<T> { |
| 2925 const B(); |
| 2926 } |
| 2927 class C { |
| 2928 void foo<T>([B<T> b = const B()]) {} |
| 2929 } |
| 2930 '''); |
| 2931 } |
| 2932 |
| 2933 test_defaultValue_refersToGenericClass_methodG_classG() { |
| 2934 checkLibrary(''' |
| 2935 class B<T1, T2> { |
| 2936 const B(); |
| 2937 } |
| 2938 class C<E1> { |
| 2939 void foo<E2>([B<E1, E2> b = const B()]) {} |
| 2940 } |
| 2941 '''); |
| 2942 } |
| 2943 |
| 2944 test_defaultValue_refersToGenericClass_methodNG() { |
| 2945 checkLibrary(''' |
| 2946 class B<T> { |
| 2947 const B(); |
| 2948 } |
| 2949 class C<T> { |
| 2950 void foo([B<T> b = const B()]) {} |
| 2951 } |
| 2952 '''); |
| 2953 } |
| 2954 |
| 2913 test_enum_documented() { | 2955 test_enum_documented() { |
| 2914 checkLibrary(''' | 2956 checkLibrary(''' |
| 2915 // Extra comment so doc comment offset != 0 | 2957 // Extra comment so doc comment offset != 0 |
| 2916 /** | 2958 /** |
| 2917 * Docs | 2959 * Docs |
| 2918 */ | 2960 */ |
| 2919 enum E { v }'''); | 2961 enum E { v }'''); |
| 2920 } | 2962 } |
| 2921 | 2963 |
| 2922 test_enum_value_documented() { | 2964 test_enum_value_documented() { |
| (...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4556 fail('Unexpectedly tried to get unlinked summary for $uri'); | 4598 fail('Unexpectedly tried to get unlinked summary for $uri'); |
| 4557 } | 4599 } |
| 4558 return serializedUnit; | 4600 return serializedUnit; |
| 4559 } | 4601 } |
| 4560 | 4602 |
| 4561 @override | 4603 @override |
| 4562 bool hasLibrarySummary(String uri) { | 4604 bool hasLibrarySummary(String uri) { |
| 4563 return true; | 4605 return true; |
| 4564 } | 4606 } |
| 4565 } | 4607 } |
| OLD | NEW |