From 77a7ca98a2eab23ca65d65daa3667692e33ce3d5 Mon Sep 17 00:00:00 2001 From: Jakob Roland Andersen Date: Thu, 7 Sep 2017 11:14:52 +0200 Subject: [PATCH] Migrate test batch 226 to Dart 2.0 Specifically skipped formatting these files, since there are tests that depend on non-standard source formatting. Bug: Change-Id: I3058984458a9c63b239ed8714828ec42d33316c5 Reviewed-on: https://dart-review.googlesource.com/3440 Reviewed-by: Lasse R.H. Nielsen --- .gitattributes | 8 ++- tests/lib_2/lib_2_dart2js.status | 21 +++++++ tests/lib_2/lib_2_dartdevc.status | 7 +++ tests/lib_2/lib_2_kernel.status | 15 +++++ .../mirrors/local_isolate_test.dart | 0 .../metadata_allowed_values_import.dart | 0 .../mirrors/metadata_allowed_values_test.dart | 0 .../mirrors/metadata_class_mirror_test.dart | 3 + .../mirrors/metadata_const_map_test.dart | 0 .../metadata_constructed_constant_test.dart | 1 + .../metadata_constructor_arguments_test.dart | 1 + ...metadata_nested_constructor_call_test.dart | 1 + .../mirrors/metadata_scope_test.dart | 1 + .../mirrors/metadata_test.dart | 1 + .../mirrors/method_mirror_location_other.dart | 4 +- .../mirrors/method_mirror_location_test.dart | 15 ++--- .../mirrors/method_mirror_name_test.dart | 5 +- .../method_mirror_properties_test.dart | 7 ++- .../method_mirror_returntype_test.dart | 3 + .../method_mirror_source_line_ending_cr.dart | 1 + ...method_mirror_source_line_ending_crlf.dart | 5 +- .../method_mirror_source_line_ending_lf.dart | 5 +- ...method_mirror_source_line_ending_test.dart | 0 .../mirrors/method_mirror_source_other.dart | 0 .../mirrors/method_mirror_source_test.dart | 56 ++++++++++--------- tests/lib_strong/lib_strong.status | 13 ----- tests/lib_strong/lib_strong_kernel.status | 6 -- .../method_mirror_source_line_ending_cr.dart | 14 ----- 28 files changed, 115 insertions(+), 78 deletions(-) rename tests/{lib_strong => lib_2}/mirrors/local_isolate_test.dart (100%) rename tests/{lib_strong => lib_2}/mirrors/metadata_allowed_values_import.dart (100%) rename tests/{lib_strong => lib_2}/mirrors/metadata_allowed_values_test.dart (100%) rename tests/{lib_strong => lib_2}/mirrors/metadata_class_mirror_test.dart (91%) rename tests/{lib_strong => lib_2}/mirrors/metadata_const_map_test.dart (100%) rename tests/{lib_strong => lib_2}/mirrors/metadata_constructed_constant_test.dart (91%) rename tests/{lib_strong => lib_2}/mirrors/metadata_constructor_arguments_test.dart (96%) rename tests/{lib_strong => lib_2}/mirrors/metadata_nested_constructor_call_test.dart (96%) rename tests/{lib_strong => lib_2}/mirrors/metadata_scope_test.dart (97%) rename tests/{lib_strong => lib_2}/mirrors/metadata_test.dart (97%) rename tests/{lib_strong => lib_2}/mirrors/method_mirror_location_other.dart (85%) rename tests/{lib_strong => lib_2}/mirrors/method_mirror_location_test.dart (90%) rename tests/{lib_strong => lib_2}/mirrors/method_mirror_name_test.dart (82%) rename tests/{lib_strong => lib_2}/mirrors/method_mirror_properties_test.dart (93%) rename tests/{lib_strong => lib_2}/mirrors/method_mirror_returntype_test.dart (97%) create mode 100755 tests/lib_2/mirrors/method_mirror_source_line_ending_cr.dart rename tests/{lib_strong => lib_2}/mirrors/method_mirror_source_line_ending_crlf.dart (94%) rename tests/{lib_strong => lib_2}/mirrors/method_mirror_source_line_ending_lf.dart (97%) rename tests/{lib_strong => lib_2}/mirrors/method_mirror_source_line_ending_test.dart (100%) rename tests/{lib_strong => lib_2}/mirrors/method_mirror_source_other.dart (100%) rename tests/{lib_strong => lib_2}/mirrors/method_mirror_source_test.dart (64%) delete mode 100755 tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart diff --git a/.gitattributes b/.gitattributes index c4729ecd788..49b40f1f676 100644 --- a/.gitattributes +++ b/.gitattributes @@ -42,8 +42,12 @@ tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart -text tests/lib_2/mirrors/method_mirror_source_test.dart -text tests/lib_2/mirrors/method_mirror_source_other.dart -text tests/language_strong/multiline_newline_crlf.dart -text -tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart -text -tests/lib_strong/mirrors/method_mirror_source_line_ending_crlf.dart -text +tests/lib_2/mirrors/method_mirror_source_line_ending_test.dart -text +tests/lib_2/mirrors/method_mirror_source_line_ending_cr.dart -text +tests/lib_2/mirrors/method_mirror_source_line_ending_crlf.dart -text +tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart -text +tests/lib_2/mirrors/method_mirror_source_test.dart -text +tests/lib_2/mirrors/method_mirror_source_other.dart -text # Files to leave alone and not diff. *.png binary diff --git a/tests/lib_2/lib_2_dart2js.status b/tests/lib_2/lib_2_dart2js.status index 41d4f901c65..e3f8fda90b9 100644 --- a/tests/lib_2/lib_2_dart2js.status +++ b/tests/lib_2/lib_2_dart2js.status @@ -24,9 +24,30 @@ async/future_or_strong_test: RuntimeError math/random_big_test: RuntimeError # Using bigint seeds for random. mirrors/*: SkipByDesign # Mirrors not supported on web in Dart 2.0. convert/chunked_conversion_utf88_test: Slow, Pass +mirrors/metadata_scope_test/none: RuntimeError # Issue 10905 +mirrors/method_mirror_name_test: RuntimeError # Issue 6335 +mirrors/method_mirror_properties_test: RuntimeError # Issue 11861 +mirrors/method_mirror_source_test : RuntimeError # Issue 6490 +mirrors/method_mirror_source_line_ending_test : RuntimeError # Issue 6490 +mirrors/method_mirror_location_test: RuntimeError # Issue 6490 [ $compiler == dart2js ] async/future_or_strong_test: RuntimeError [ $compiler != dart2js ] async/dart2js_uncaught_error_test: Skip # JS-integration only test + +[ $compiler == dart2js && $fast_startup ] +mirrors/metadata_allowed_values_test/0*: Pass # expects failure, but it fails for the wrong reason +mirrors/metadata_allowed_values_test/1*: Pass # expects failure, but it fails for the wrong reason +mirrors/metadata_allowed_values_test/2*: Pass # expects failure, but it fails for the wrong reason +mirrors/metadata_allowed_values_test/3*: Pass # expects failure, but it fails for the wrong reason +mirrors/metadata_constructor_arguments_test/0*: Pass # expects failure, but it fails for the wrong reason +mirrors/metadata_nested_constructor_call_test/0*: Pass # expects failure, but it fails for the wrong reason +mirrors/metadata_scope_test/01: Pass # expects failure, but it fails for the wrong reason + +[ $compiler == dart2js && $host_checked ] +mirrors/metadata_allowed_values_test/28: Crash # Issue 25911 +mirrors/metadata_allowed_values_test/29: Crash # Issue 25911 +mirrors/metadata_allowed_values_test/30: Crash # Issue 25911 +mirrors/metadata_allowed_values_test/31: Crash # Issue 25911 diff --git a/tests/lib_2/lib_2_dartdevc.status b/tests/lib_2/lib_2_dartdevc.status index a515e088031..df3075675a4 100644 --- a/tests/lib_2/lib_2_dartdevc.status +++ b/tests/lib_2/lib_2_dartdevc.status @@ -13,3 +13,10 @@ async/futures_test: RuntimeError # Issue 29922 async/slow_consumer_test: Pass, Timeout # Issue 29922 math/random_big_test: RuntimeError # Issue 29922 typed_data/typed_data_list_test: RuntimeError # Issue 29922 +mirrors/local_isolate_test: RuntimeError # Issue 29922 +mirrors/metadata_constructed_constant_test: RuntimeError # Issue 29922 +mirrors/metadata_test: RuntimeError # Issue 29922 +mirrors/method_mirror_location_test: RuntimeError # Issue 29922 +mirrors/method_mirror_returntype_test: RuntimeError # Issue 29922 +mirrors/method_mirror_source_line_ending_test: RuntimeError # Issue 29922 +mirrors/method_mirror_source_test: RuntimeError # Issue 29922 diff --git a/tests/lib_2/lib_2_kernel.status b/tests/lib_2/lib_2_kernel.status index 1924b004e17..76bc14d3482 100644 --- a/tests/lib_2/lib_2_kernel.status +++ b/tests/lib_2/lib_2_kernel.status @@ -27,6 +27,17 @@ mirrors/deferred_mirrors_update_test: CompileTimeError # Deferred loading kernel mirrors/generic_mixin_applications_test: RuntimeError mirrors/generic_mixin_test: RuntimeError mirrors/mirrors_test: Crash +mirrors/metadata_allowed_values_test/02: MissingCompileTimeError +mirrors/metadata_allowed_values_test/13: MissingCompileTimeError +mirrors/metadata_allowed_values_test/14: MissingCompileTimeError +mirrors/metadata_allowed_values_test/16: Skip # Flaky, crashes. +mirrors/metadata_allowed_values_test/27: Crash +mirrors/metadata_constructed_constant_test: Crash +mirrors/metadata_constructor_arguments_test/04: MissingCompileTimeError +mirrors/metadata_scope_test/none: RuntimeError +mirrors/method_mirror_location_test: RuntimeError +mirrors/method_mirror_source_line_ending_test: Crash +mirrors/method_mirror_source_test: Crash [ $compiler == dartk && $runtime == vm ] mirrors/class_mirror_location_test: RuntimeError @@ -42,3 +53,7 @@ mirrors/empty_test: RuntimeError mirrors/equality_test: RuntimeError mirrors/generic_mixin_applications_test: RuntimeError mirrors/generic_mixin_test: RuntimeError +mirrors/metadata_constructed_constant_test: RuntimeError +mirrors/method_mirror_location_test: RuntimeError +mirrors/method_mirror_source_line_ending_test: Crash +mirrors/method_mirror_source_test: Crash diff --git a/tests/lib_strong/mirrors/local_isolate_test.dart b/tests/lib_2/mirrors/local_isolate_test.dart similarity index 100% rename from tests/lib_strong/mirrors/local_isolate_test.dart rename to tests/lib_2/mirrors/local_isolate_test.dart diff --git a/tests/lib_strong/mirrors/metadata_allowed_values_import.dart b/tests/lib_2/mirrors/metadata_allowed_values_import.dart similarity index 100% rename from tests/lib_strong/mirrors/metadata_allowed_values_import.dart rename to tests/lib_2/mirrors/metadata_allowed_values_import.dart diff --git a/tests/lib_strong/mirrors/metadata_allowed_values_test.dart b/tests/lib_2/mirrors/metadata_allowed_values_test.dart similarity index 100% rename from tests/lib_strong/mirrors/metadata_allowed_values_test.dart rename to tests/lib_2/mirrors/metadata_allowed_values_test.dart diff --git a/tests/lib_strong/mirrors/metadata_class_mirror_test.dart b/tests/lib_2/mirrors/metadata_class_mirror_test.dart similarity index 91% rename from tests/lib_strong/mirrors/metadata_class_mirror_test.dart rename to tests/lib_2/mirrors/metadata_class_mirror_test.dart index aacb041cd8e..9391f1ea080 100644 --- a/tests/lib_strong/mirrors/metadata_class_mirror_test.dart +++ b/tests/lib_2/mirrors/metadata_class_mirror_test.dart @@ -4,6 +4,9 @@ // Regression test for http://dartbug.com/19173 +library lib; + +@MirrorsUsed(targets: "lib") import 'dart:mirrors'; class A { diff --git a/tests/lib_strong/mirrors/metadata_const_map_test.dart b/tests/lib_2/mirrors/metadata_const_map_test.dart similarity index 100% rename from tests/lib_strong/mirrors/metadata_const_map_test.dart rename to tests/lib_2/mirrors/metadata_const_map_test.dart diff --git a/tests/lib_strong/mirrors/metadata_constructed_constant_test.dart b/tests/lib_2/mirrors/metadata_constructed_constant_test.dart similarity index 91% rename from tests/lib_strong/mirrors/metadata_constructed_constant_test.dart rename to tests/lib_2/mirrors/metadata_constructed_constant_test.dart index afcd044ca54..7d0bf487d26 100644 --- a/tests/lib_strong/mirrors/metadata_constructed_constant_test.dart +++ b/tests/lib_2/mirrors/metadata_constructed_constant_test.dart @@ -5,6 +5,7 @@ library test.metadata_constructed_constant_test; +@MirrorsUsed(targets: "test.metadata_constructed_constant_test") import 'dart:mirrors'; import 'package:expect/expect.dart'; diff --git a/tests/lib_strong/mirrors/metadata_constructor_arguments_test.dart b/tests/lib_2/mirrors/metadata_constructor_arguments_test.dart similarity index 96% rename from tests/lib_strong/mirrors/metadata_constructor_arguments_test.dart rename to tests/lib_2/mirrors/metadata_constructor_arguments_test.dart index bc459e911ae..3b1bb24d4d3 100644 --- a/tests/lib_strong/mirrors/metadata_constructor_arguments_test.dart +++ b/tests/lib_2/mirrors/metadata_constructor_arguments_test.dart @@ -7,6 +7,7 @@ library test.metadata_constructor_arguments; +@MirrorsUsed(targets: "test.metadata_constructor_arguments") import 'dart:mirrors'; import 'package:expect/expect.dart'; diff --git a/tests/lib_strong/mirrors/metadata_nested_constructor_call_test.dart b/tests/lib_2/mirrors/metadata_nested_constructor_call_test.dart similarity index 96% rename from tests/lib_strong/mirrors/metadata_nested_constructor_call_test.dart rename to tests/lib_2/mirrors/metadata_nested_constructor_call_test.dart index 00bb6c0afa0..c35e3631304 100644 --- a/tests/lib_strong/mirrors/metadata_nested_constructor_call_test.dart +++ b/tests/lib_2/mirrors/metadata_nested_constructor_call_test.dart @@ -7,6 +7,7 @@ library test.metadata_nested_constructor_call; +@MirrorsUsed(targets: "test.metadata_nested_constructor_call") import 'dart:mirrors'; import 'package:expect/expect.dart'; diff --git a/tests/lib_strong/mirrors/metadata_scope_test.dart b/tests/lib_2/mirrors/metadata_scope_test.dart similarity index 97% rename from tests/lib_strong/mirrors/metadata_scope_test.dart rename to tests/lib_2/mirrors/metadata_scope_test.dart index 521dee6563a..40a207e6a96 100644 --- a/tests/lib_strong/mirrors/metadata_scope_test.dart +++ b/tests/lib_2/mirrors/metadata_scope_test.dart @@ -4,6 +4,7 @@ library test.metadata_scope; +@MirrorsUsed(targets: "test.metadata_scope") import 'dart:mirrors'; import 'package:expect/expect.dart'; diff --git a/tests/lib_strong/mirrors/metadata_test.dart b/tests/lib_2/mirrors/metadata_test.dart similarity index 97% rename from tests/lib_strong/mirrors/metadata_test.dart rename to tests/lib_2/mirrors/metadata_test.dart index 2fe04fa810d..5081653d524 100644 --- a/tests/lib_strong/mirrors/metadata_test.dart +++ b/tests/lib_2/mirrors/metadata_test.dart @@ -4,6 +4,7 @@ library test.metadata_test; +@MirrorsUsed(targets: "test.metadata_test") import 'dart:mirrors'; const string = 'a metadata string'; diff --git a/tests/lib_strong/mirrors/method_mirror_location_other.dart b/tests/lib_2/mirrors/method_mirror_location_other.dart similarity index 85% rename from tests/lib_strong/mirrors/method_mirror_location_other.dart rename to tests/lib_2/mirrors/method_mirror_location_other.dart index 510e6f707c0..1747eb9342f 100644 --- a/tests/lib_strong/mirrors/method_mirror_location_other.dart +++ b/tests/lib_2/mirrors/method_mirror_location_other.dart @@ -12,6 +12,6 @@ class ClassInOtherFile { topLevelInOtherFile() {} -spaceIdentedInOtherFile() {} + spaceIdentedInOtherFile() {} -tabIdentedInOtherFile() {} + tabIdentedInOtherFile() {} diff --git a/tests/lib_strong/mirrors/method_mirror_location_test.dart b/tests/lib_2/mirrors/method_mirror_location_test.dart similarity index 90% rename from tests/lib_strong/mirrors/method_mirror_location_test.dart rename to tests/lib_2/mirrors/method_mirror_location_test.dart index 8f4769549ff..16c0c0fdddd 100644 --- a/tests/lib_strong/mirrors/method_mirror_location_test.dart +++ b/tests/lib_2/mirrors/method_mirror_location_test.dart @@ -27,14 +27,15 @@ expectLocation(Mirror mirror, String uriSuffix, int line, int column) { } class ClassInMainFile { + ClassInMainFile(); method() {} } void topLevelInMainFile() {} -spaceIdentedInMainFile() {} -tabIdentedInMainFile() {} + spaceIdentedInMainFile() {} + tabIdentedInMainFile() {} class HasImplicitConstructor {} @@ -60,12 +61,12 @@ main() { // Another part. expectLocation(reflectClass(ClassInOtherFile).declarations[#ClassInOtherFile], - otherSuffix, 9, 3); + otherSuffix, 8, 3); expectLocation( - reflectClass(ClassInOtherFile).declarations[#method], otherSuffix, 11, 3); - expectLocation(reflect(topLevelInOtherFile), otherSuffix, 14, 1); - expectLocation(reflect(spaceIdentedInOtherFile), otherSuffix, 16, 3); - expectLocation(reflect(tabIdentedInOtherFile), otherSuffix, 18, 2); + reflectClass(ClassInOtherFile).declarations[#method], otherSuffix, 10, 3); + expectLocation(reflect(topLevelInOtherFile), otherSuffix, 13, 1); + expectLocation(reflect(spaceIdentedInOtherFile), otherSuffix, 15, 3); + expectLocation(reflect(tabIdentedInOtherFile), otherSuffix, 17, 2); // Synthetic methods. Expect.isNull(reflectClass(HasImplicitConstructor) diff --git a/tests/lib_strong/mirrors/method_mirror_name_test.dart b/tests/lib_2/mirrors/method_mirror_name_test.dart similarity index 82% rename from tests/lib_strong/mirrors/method_mirror_name_test.dart rename to tests/lib_2/mirrors/method_mirror_name_test.dart index cec96a7f2ac..1f6b94897a9 100644 --- a/tests/lib_strong/mirrors/method_mirror_name_test.dart +++ b/tests/lib_2/mirrors/method_mirror_name_test.dart @@ -2,6 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +library lib; + +@MirrorsUsed(targets: "lib") import "dart:mirrors"; import "package:expect/expect.dart"; @@ -11,7 +14,7 @@ doNothing42() {} main() { // Regression test for http://www.dartbug.com/6335 - var closureMirror = reflect(doNothing42); + var closureMirror = reflect(doNothing42) as ClosureMirror; Expect.equals( stringifySymbol(closureMirror.function.simpleName), "s(doNothing42)"); } diff --git a/tests/lib_strong/mirrors/method_mirror_properties_test.dart b/tests/lib_2/mirrors/method_mirror_properties_test.dart similarity index 93% rename from tests/lib_strong/mirrors/method_mirror_properties_test.dart rename to tests/lib_2/mirrors/method_mirror_properties_test.dart index 02ba7c35cdc..ef1212f3105 100644 --- a/tests/lib_strong/mirrors/method_mirror_properties_test.dart +++ b/tests/lib_2/mirrors/method_mirror_properties_test.dart @@ -2,6 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +library lib; + +@MirrorsUsed(targets: "lib") import "dart:mirrors"; import "package:expect/expect.dart"; @@ -44,9 +47,9 @@ checkKinds(method, kinds) { main() { // Top level functions should be static. - var closureMirror = reflect(doNothing42); + var closureMirror = reflect(doNothing42) as ClosureMirror; checkKinds(closureMirror.function, [true, false, false, false, false]); - var libraryMirror = reflectClass(C).owner; + var libraryMirror = reflectClass(C).owner as LibraryMirror; checkKinds(libraryMirror.declarations[#topGetter], [true, false, true, false, false]); checkKinds(libraryMirror.declarations[const Symbol("topSetter=")], diff --git a/tests/lib_strong/mirrors/method_mirror_returntype_test.dart b/tests/lib_2/mirrors/method_mirror_returntype_test.dart similarity index 97% rename from tests/lib_strong/mirrors/method_mirror_returntype_test.dart rename to tests/lib_2/mirrors/method_mirror_returntype_test.dart index 362fe76e88a..195c4bf4fb8 100644 --- a/tests/lib_strong/mirrors/method_mirror_returntype_test.dart +++ b/tests/lib_2/mirrors/method_mirror_returntype_test.dart @@ -2,6 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +library lib; + +@MirrorsUsed(targets: "lib") import "dart:mirrors"; import "package:expect/expect.dart"; diff --git a/tests/lib_2/mirrors/method_mirror_source_line_ending_cr.dart b/tests/lib_2/mirrors/method_mirror_source_line_ending_cr.dart new file mode 100755 index 00000000000..45533d47348 --- /dev/null +++ b/tests/lib_2/mirrors/method_mirror_source_line_ending_cr.dart @@ -0,0 +1 @@ +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. // Note: This test relies on CR line endings in the source file. library line_endings.cr; oneLineCR(x) => x; multiLineCR(y) { return y + 1; } b (){ } diff --git a/tests/lib_strong/mirrors/method_mirror_source_line_ending_crlf.dart b/tests/lib_2/mirrors/method_mirror_source_line_ending_crlf.dart similarity index 94% rename from tests/lib_strong/mirrors/method_mirror_source_line_ending_crlf.dart rename to tests/lib_2/mirrors/method_mirror_source_line_ending_crlf.dart index 1fc3ac0b1c6..d93615cd83b 100755 --- a/tests/lib_strong/mirrors/method_mirror_source_line_ending_crlf.dart +++ b/tests/lib_2/mirrors/method_mirror_source_line_ending_crlf.dart @@ -10,5 +10,6 @@ oneLineCRLF(x) => x; multiLineCRLF(y) { return y + 1; } - -c() {} +c +(){ +} diff --git a/tests/lib_strong/mirrors/method_mirror_source_line_ending_lf.dart b/tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart similarity index 97% rename from tests/lib_strong/mirrors/method_mirror_source_line_ending_lf.dart rename to tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart index 704a745f2bb..b805a757a5d 100755 --- a/tests/lib_strong/mirrors/method_mirror_source_line_ending_lf.dart +++ b/tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart @@ -10,5 +10,6 @@ oneLineLF(x) => x; multiLineLF(y) { return y + 1; } - -a() {} +a +(){ +} diff --git a/tests/lib_strong/mirrors/method_mirror_source_line_ending_test.dart b/tests/lib_2/mirrors/method_mirror_source_line_ending_test.dart similarity index 100% rename from tests/lib_strong/mirrors/method_mirror_source_line_ending_test.dart rename to tests/lib_2/mirrors/method_mirror_source_line_ending_test.dart diff --git a/tests/lib_strong/mirrors/method_mirror_source_other.dart b/tests/lib_2/mirrors/method_mirror_source_other.dart similarity index 100% rename from tests/lib_strong/mirrors/method_mirror_source_other.dart rename to tests/lib_2/mirrors/method_mirror_source_other.dart diff --git a/tests/lib_strong/mirrors/method_mirror_source_test.dart b/tests/lib_2/mirrors/method_mirror_source_test.dart similarity index 64% rename from tests/lib_strong/mirrors/method_mirror_source_test.dart rename to tests/lib_2/mirrors/method_mirror_source_test.dart index cf7ca692d55..c648ee0b545 100644 --- a/tests/lib_strong/mirrors/method_mirror_source_test.dart +++ b/tests/lib_2/mirrors/method_mirror_source_test.dart @@ -23,17 +23,18 @@ foo1() {} doSomething(e) => e; int get x => 42; -set x(value) {} +set x(value) { } class S {} class C extends S { + var _x; var _y; C(this._x, y) - : _y = y, - super(); + : _y = y, + super(); factory C.other(num z) {} factory C.other2() {} @@ -45,64 +46,65 @@ class C extends S { // Some comment. - void bar() {/* Not so happy bar. */} + void bar() { /* Not so happy bar. */ } - num get someX => 181; + num get someX => + 181; set someX(v) { // Discard this one. } } + main() { // Top-level members LibraryMirror lib = reflectClass(C).owner; - expectSource(lib.declarations[#foo1], "foo1() {}"); - expectSource(lib.declarations[#x], "int get x => 42;"); - expectSource(lib.declarations[const Symbol("x=")], "set x(value) { }"); + expectSource(lib.declarations[#foo1], + "foo1() {}"); + expectSource(lib.declarations[#x], + "int get x => 42;"); + expectSource(lib.declarations[const Symbol("x=")], + "set x(value) { }"); // Class members ClassMirror cm = reflectClass(C); - expectSource( - cm.declarations[#foo], + expectSource(cm.declarations[#foo], "static dynamic foo() {\n" " // Happy foo.\n" " }"); - expectSource(cm.declarations[#bar], "void bar() { /* Not so happy bar. */ }"); - expectSource( - cm.declarations[#someX], + expectSource(cm.declarations[#bar], + "void bar() { /* Not so happy bar. */ }"); + expectSource(cm.declarations[#someX], "num get someX =>\n" " 181;"); - expectSource( - cm.declarations[const Symbol("someX=")], + expectSource(cm.declarations[const Symbol("someX=")], "set someX(v) {\n" " // Discard this one.\n" " }"); - expectSource( - cm.declarations[#C], + expectSource(cm.declarations[#C], "C(this._x, y)\n" " : _y = y,\n" " super();"); - expectSource(cm.declarations[#C.other], "factory C.other(num z) {}"); - expectSource(cm.declarations[#C.other3], "factory C.other3() = C.other2;"); + expectSource(cm.declarations[#C.other], + "factory C.other(num z) {}"); + expectSource(cm.declarations[#C.other3], + "factory C.other3() = C.other2;"); // Closures - expectSource(reflect(() {}), "(){}"); - expectSource(reflect((x, y, z) { - return x * y * z; - }), "(x,y,z) { return x*y*z; }"); + expectSource(reflect((){}), "(){}"); + expectSource(reflect((x,y,z) { return x*y*z; }), "(x,y,z) { return x*y*z; }"); expectSource(reflect((e) => doSomething(e)), "(e) => doSomething(e)"); - namedClosure(x, y, z) => 1; + namedClosure(x,y,z) => 1; var a = () {}; expectSource(reflect(namedClosure), "namedClosure(x,y,z) => 1;"); expectSource(reflect(a), "() {}"); // Function at first line. LibraryMirror otherLib = reflectClass(SomethingInOther).owner; - expectSource( - otherLib.declarations[#main], - """main() { + expectSource(otherLib.declarations[#main], +"""main() { print("Blah"); }"""); } diff --git a/tests/lib_strong/lib_strong.status b/tests/lib_strong/lib_strong.status index 2a656765db3..07aeb95b316 100644 --- a/tests/lib_strong/lib_strong.status +++ b/tests/lib_strong/lib_strong.status @@ -91,12 +91,6 @@ mirrors/library_imports_prefixed_test: Skip mirrors/library_imports_shown_test: Skip mirrors/library_metadata2_test: Skip mirrors/load_library_test: Skip -mirrors/metadata_allowed_values_test: Skip -mirrors/metadata_constructor_arguments_test: Skip -mirrors/metadata_nested_constructor_call_test: Skip -mirrors/metadata_scope_test: Skip -mirrors/method_mirror_name_test: Skip -mirrors/method_mirror_properties_test: Skip mirrors/mirror_in_static_init_test: Skip mirrors/mirrors_nsm_mismatch_test: Skip mirrors/mirrors_nsm_test: Skip @@ -251,13 +245,6 @@ mirrors/library_metadata_test: RuntimeError # Issue 29922 mirrors/library_uri_io_test: RuntimeError # Issue 29922 mirrors/library_uri_package_test: RuntimeError # Issue 29922 mirrors/local_function_is_static_test: RuntimeError # Issue 29922 -mirrors/local_isolate_test: RuntimeError # Issue 29922 -mirrors/metadata_constructed_constant_test: RuntimeError # Issue 29922 -mirrors/metadata_test: RuntimeError # Issue 29922 -mirrors/method_mirror_location_test: RuntimeError # Issue 29922 -mirrors/method_mirror_returntype_test: RuntimeError # Issue 29922 -mirrors/method_mirror_source_line_ending_test: RuntimeError # Issue 29922 -mirrors/method_mirror_source_test: RuntimeError # Issue 29922 mirrors/mirrors_reader_test: RuntimeError # Issue 29922 mirrors/mirrors_used_typedef_declaration_test/01: RuntimeError # Issue 29922 mirrors/mirrors_used_typedef_declaration_test/none: RuntimeError # Issue 29922 diff --git a/tests/lib_strong/lib_strong_kernel.status b/tests/lib_strong/lib_strong_kernel.status index 53aac83016c..e2d5850fb34 100644 --- a/tests/lib_strong/lib_strong_kernel.status +++ b/tests/lib_strong/lib_strong_kernel.status @@ -201,12 +201,6 @@ mirrors/library_uri_io_test: DartkCompileTimeError mirrors/library_uri_package_test: DartkCompileTimeError mirrors/list_constructor_test/01: RuntimeError mirrors/list_constructor_test/none: RuntimeError -mirrors/metadata_constructed_constant_test: RuntimeError -mirrors/metadata_test: RuntimeError -mirrors/method_mirror_location_test: RuntimeError -mirrors/method_mirror_returntype_test: RuntimeError -mirrors/method_mirror_source_line_ending_test: Crash -mirrors/method_mirror_source_test: Crash mirrors/mirrors_reader_test: Crash mirrors/mirrors_used_typedef_declaration_test/01: RuntimeError mirrors/mirrors_used_typedef_declaration_test/none: RuntimeError diff --git a/tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart b/tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart deleted file mode 100755 index d83f6b605f5..00000000000 --- a/tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// Note: This test relies on CR line endings in the source file. - -library line_endings.cr; - -oneLineCR(x) => x; -multiLineCR(y) { - return y + 1; -} - -b() {}