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 <lrn@google.com>
This commit is contained in:
+6
-2
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+3
@@ -4,6 +4,9 @@
|
||||
|
||||
// Regression test for http://dartbug.com/19173
|
||||
|
||||
library lib;
|
||||
|
||||
@MirrorsUsed(targets: "lib")
|
||||
import 'dart:mirrors';
|
||||
|
||||
class A {
|
||||
+1
@@ -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';
|
||||
+1
@@ -7,6 +7,7 @@
|
||||
|
||||
library test.metadata_constructor_arguments;
|
||||
|
||||
@MirrorsUsed(targets: "test.metadata_constructor_arguments")
|
||||
import 'dart:mirrors';
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
+1
@@ -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';
|
||||
|
||||
+1
@@ -4,6 +4,7 @@
|
||||
|
||||
library test.metadata_scope;
|
||||
|
||||
@MirrorsUsed(targets: "test.metadata_scope")
|
||||
import 'dart:mirrors';
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
library test.metadata_test;
|
||||
|
||||
@MirrorsUsed(targets: "test.metadata_test")
|
||||
import 'dart:mirrors';
|
||||
|
||||
const string = 'a metadata string';
|
||||
+2
-2
@@ -12,6 +12,6 @@ class ClassInOtherFile {
|
||||
|
||||
topLevelInOtherFile() {}
|
||||
|
||||
spaceIdentedInOtherFile() {}
|
||||
spaceIdentedInOtherFile() {}
|
||||
|
||||
tabIdentedInOtherFile() {}
|
||||
tabIdentedInOtherFile() {}
|
||||
+8
-7
@@ -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)
|
||||
+4
-1
@@ -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)");
|
||||
}
|
||||
+5
-2
@@ -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=")],
|
||||
+3
@@ -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";
|
||||
@@ -0,0 +1 @@
|
||||
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
||||
+3
-2
@@ -10,5 +10,6 @@ oneLineCRLF(x) => x;
|
||||
multiLineCRLF(y) {
|
||||
return y + 1;
|
||||
}
|
||||
|
||||
c() {}
|
||||
c
|
||||
(){
|
||||
}
|
||||
+3
-2
@@ -10,5 +10,6 @@ oneLineLF(x) => x;
|
||||
multiLineLF(y) {
|
||||
return y + 1;
|
||||
}
|
||||
|
||||
a() {}
|
||||
a
|
||||
(){
|
||||
}
|
||||
+29
-27
@@ -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");
|
||||
}""");
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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() {}
|
||||
Reference in New Issue
Block a user