mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 16:00:45 +00:00
Revert "Migrate test batch 226 to Dart 2.0"
This reverts commit 77a7ca98a2
.
Reason for revert: Migrated a test file that's still being used by the unmigrated tests.
Original change's description:
> 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>
TBR=jakobr@google.com,lrn@google.com
Change-Id: If4d0b44f81cfadf290bf72b23765fa85a6580937
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/3900
Reviewed-by: Jakob Roland Andersen <jakobr@google.com>
This commit is contained in:
parent
77a7ca98a2
commit
b4835cce26
8
.gitattributes
vendored
8
.gitattributes
vendored
|
@ -42,12 +42,8 @@ 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_test.dart -text
|
||||||
tests/lib_2/mirrors/method_mirror_source_other.dart -text
|
tests/lib_2/mirrors/method_mirror_source_other.dart -text
|
||||||
tests/language_strong/multiline_newline_crlf.dart -text
|
tests/language_strong/multiline_newline_crlf.dart -text
|
||||||
tests/lib_2/mirrors/method_mirror_source_line_ending_test.dart -text
|
tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart -text
|
||||||
tests/lib_2/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_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.
|
# Files to leave alone and not diff.
|
||||||
*.png binary
|
*.png binary
|
||||||
|
|
|
@ -24,30 +24,9 @@ async/future_or_strong_test: RuntimeError
|
||||||
math/random_big_test: RuntimeError # Using bigint seeds for random.
|
math/random_big_test: RuntimeError # Using bigint seeds for random.
|
||||||
mirrors/*: SkipByDesign # Mirrors not supported on web in Dart 2.0.
|
mirrors/*: SkipByDesign # Mirrors not supported on web in Dart 2.0.
|
||||||
convert/chunked_conversion_utf88_test: Slow, Pass
|
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 ]
|
[ $compiler == dart2js ]
|
||||||
async/future_or_strong_test: RuntimeError
|
async/future_or_strong_test: RuntimeError
|
||||||
|
|
||||||
[ $compiler != dart2js ]
|
[ $compiler != dart2js ]
|
||||||
async/dart2js_uncaught_error_test: Skip # JS-integration only test
|
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,10 +13,3 @@ async/futures_test: RuntimeError # Issue 29922
|
||||||
async/slow_consumer_test: Pass, Timeout # Issue 29922
|
async/slow_consumer_test: Pass, Timeout # Issue 29922
|
||||||
math/random_big_test: RuntimeError # Issue 29922
|
math/random_big_test: RuntimeError # Issue 29922
|
||||||
typed_data/typed_data_list_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,17 +27,6 @@ mirrors/deferred_mirrors_update_test: CompileTimeError # Deferred loading kernel
|
||||||
mirrors/generic_mixin_applications_test: RuntimeError
|
mirrors/generic_mixin_applications_test: RuntimeError
|
||||||
mirrors/generic_mixin_test: RuntimeError
|
mirrors/generic_mixin_test: RuntimeError
|
||||||
mirrors/mirrors_test: Crash
|
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 ]
|
[ $compiler == dartk && $runtime == vm ]
|
||||||
mirrors/class_mirror_location_test: RuntimeError
|
mirrors/class_mirror_location_test: RuntimeError
|
||||||
|
@ -53,7 +42,3 @@ mirrors/empty_test: RuntimeError
|
||||||
mirrors/equality_test: RuntimeError
|
mirrors/equality_test: RuntimeError
|
||||||
mirrors/generic_mixin_applications_test: RuntimeError
|
mirrors/generic_mixin_applications_test: RuntimeError
|
||||||
mirrors/generic_mixin_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
|
|
||||||
|
|
|
@ -1 +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
(){
}
|
|
|
@ -91,6 +91,12 @@ mirrors/library_imports_prefixed_test: Skip
|
||||||
mirrors/library_imports_shown_test: Skip
|
mirrors/library_imports_shown_test: Skip
|
||||||
mirrors/library_metadata2_test: Skip
|
mirrors/library_metadata2_test: Skip
|
||||||
mirrors/load_library_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/mirror_in_static_init_test: Skip
|
||||||
mirrors/mirrors_nsm_mismatch_test: Skip
|
mirrors/mirrors_nsm_mismatch_test: Skip
|
||||||
mirrors/mirrors_nsm_test: Skip
|
mirrors/mirrors_nsm_test: Skip
|
||||||
|
@ -245,6 +251,13 @@ mirrors/library_metadata_test: RuntimeError # Issue 29922
|
||||||
mirrors/library_uri_io_test: RuntimeError # Issue 29922
|
mirrors/library_uri_io_test: RuntimeError # Issue 29922
|
||||||
mirrors/library_uri_package_test: RuntimeError # Issue 29922
|
mirrors/library_uri_package_test: RuntimeError # Issue 29922
|
||||||
mirrors/local_function_is_static_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_reader_test: RuntimeError # Issue 29922
|
||||||
mirrors/mirrors_used_typedef_declaration_test/01: RuntimeError # Issue 29922
|
mirrors/mirrors_used_typedef_declaration_test/01: RuntimeError # Issue 29922
|
||||||
mirrors/mirrors_used_typedef_declaration_test/none: RuntimeError # Issue 29922
|
mirrors/mirrors_used_typedef_declaration_test/none: RuntimeError # Issue 29922
|
||||||
|
|
|
@ -201,6 +201,12 @@ mirrors/library_uri_io_test: DartkCompileTimeError
|
||||||
mirrors/library_uri_package_test: DartkCompileTimeError
|
mirrors/library_uri_package_test: DartkCompileTimeError
|
||||||
mirrors/list_constructor_test/01: RuntimeError
|
mirrors/list_constructor_test/01: RuntimeError
|
||||||
mirrors/list_constructor_test/none: 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_reader_test: Crash
|
||||||
mirrors/mirrors_used_typedef_declaration_test/01: RuntimeError
|
mirrors/mirrors_used_typedef_declaration_test/01: RuntimeError
|
||||||
mirrors/mirrors_used_typedef_declaration_test/none: RuntimeError
|
mirrors/mirrors_used_typedef_declaration_test/none: RuntimeError
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
|
|
||||||
// Regression test for http://dartbug.com/19173
|
// Regression test for http://dartbug.com/19173
|
||||||
|
|
||||||
library lib;
|
|
||||||
|
|
||||||
@MirrorsUsed(targets: "lib")
|
|
||||||
import 'dart:mirrors';
|
import 'dart:mirrors';
|
||||||
|
|
||||||
class A {
|
class A {
|
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
library test.metadata_constructed_constant_test;
|
library test.metadata_constructed_constant_test;
|
||||||
|
|
||||||
@MirrorsUsed(targets: "test.metadata_constructed_constant_test")
|
|
||||||
import 'dart:mirrors';
|
import 'dart:mirrors';
|
||||||
|
|
||||||
import 'package:expect/expect.dart';
|
import 'package:expect/expect.dart';
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
library test.metadata_constructor_arguments;
|
library test.metadata_constructor_arguments;
|
||||||
|
|
||||||
@MirrorsUsed(targets: "test.metadata_constructor_arguments")
|
|
||||||
import 'dart:mirrors';
|
import 'dart:mirrors';
|
||||||
import 'package:expect/expect.dart';
|
import 'package:expect/expect.dart';
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
library test.metadata_nested_constructor_call;
|
library test.metadata_nested_constructor_call;
|
||||||
|
|
||||||
@MirrorsUsed(targets: "test.metadata_nested_constructor_call")
|
|
||||||
import 'dart:mirrors';
|
import 'dart:mirrors';
|
||||||
import 'package:expect/expect.dart';
|
import 'package:expect/expect.dart';
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
library test.metadata_scope;
|
library test.metadata_scope;
|
||||||
|
|
||||||
@MirrorsUsed(targets: "test.metadata_scope")
|
|
||||||
import 'dart:mirrors';
|
import 'dart:mirrors';
|
||||||
import 'package:expect/expect.dart';
|
import 'package:expect/expect.dart';
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
library test.metadata_test;
|
library test.metadata_test;
|
||||||
|
|
||||||
@MirrorsUsed(targets: "test.metadata_test")
|
|
||||||
import 'dart:mirrors';
|
import 'dart:mirrors';
|
||||||
|
|
||||||
const string = 'a metadata string';
|
const string = 'a metadata string';
|
|
@ -27,7 +27,6 @@ expectLocation(Mirror mirror, String uriSuffix, int line, int column) {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ClassInMainFile {
|
class ClassInMainFile {
|
||||||
|
|
||||||
ClassInMainFile();
|
ClassInMainFile();
|
||||||
|
|
||||||
method() {}
|
method() {}
|
||||||
|
@ -61,12 +60,12 @@ main() {
|
||||||
|
|
||||||
// Another part.
|
// Another part.
|
||||||
expectLocation(reflectClass(ClassInOtherFile).declarations[#ClassInOtherFile],
|
expectLocation(reflectClass(ClassInOtherFile).declarations[#ClassInOtherFile],
|
||||||
otherSuffix, 8, 3);
|
otherSuffix, 9, 3);
|
||||||
expectLocation(
|
expectLocation(
|
||||||
reflectClass(ClassInOtherFile).declarations[#method], otherSuffix, 10, 3);
|
reflectClass(ClassInOtherFile).declarations[#method], otherSuffix, 11, 3);
|
||||||
expectLocation(reflect(topLevelInOtherFile), otherSuffix, 13, 1);
|
expectLocation(reflect(topLevelInOtherFile), otherSuffix, 14, 1);
|
||||||
expectLocation(reflect(spaceIdentedInOtherFile), otherSuffix, 15, 3);
|
expectLocation(reflect(spaceIdentedInOtherFile), otherSuffix, 16, 3);
|
||||||
expectLocation(reflect(tabIdentedInOtherFile), otherSuffix, 17, 2);
|
expectLocation(reflect(tabIdentedInOtherFile), otherSuffix, 18, 2);
|
||||||
|
|
||||||
// Synthetic methods.
|
// Synthetic methods.
|
||||||
Expect.isNull(reflectClass(HasImplicitConstructor)
|
Expect.isNull(reflectClass(HasImplicitConstructor)
|
|
@ -2,9 +2,6 @@
|
||||||
// for details. All rights reserved. Use of this source code is governed by a
|
// 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.
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
library lib;
|
|
||||||
|
|
||||||
@MirrorsUsed(targets: "lib")
|
|
||||||
import "dart:mirrors";
|
import "dart:mirrors";
|
||||||
|
|
||||||
import "package:expect/expect.dart";
|
import "package:expect/expect.dart";
|
||||||
|
@ -14,7 +11,7 @@ doNothing42() {}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
// Regression test for http://www.dartbug.com/6335
|
// Regression test for http://www.dartbug.com/6335
|
||||||
var closureMirror = reflect(doNothing42) as ClosureMirror;
|
var closureMirror = reflect(doNothing42);
|
||||||
Expect.equals(
|
Expect.equals(
|
||||||
stringifySymbol(closureMirror.function.simpleName), "s(doNothing42)");
|
stringifySymbol(closureMirror.function.simpleName), "s(doNothing42)");
|
||||||
}
|
}
|
|
@ -2,9 +2,6 @@
|
||||||
// for details. All rights reserved. Use of this source code is governed by a
|
// 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.
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
library lib;
|
|
||||||
|
|
||||||
@MirrorsUsed(targets: "lib")
|
|
||||||
import "dart:mirrors";
|
import "dart:mirrors";
|
||||||
|
|
||||||
import "package:expect/expect.dart";
|
import "package:expect/expect.dart";
|
||||||
|
@ -47,9 +44,9 @@ checkKinds(method, kinds) {
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
// Top level functions should be static.
|
// Top level functions should be static.
|
||||||
var closureMirror = reflect(doNothing42) as ClosureMirror;
|
var closureMirror = reflect(doNothing42);
|
||||||
checkKinds(closureMirror.function, [true, false, false, false, false]);
|
checkKinds(closureMirror.function, [true, false, false, false, false]);
|
||||||
var libraryMirror = reflectClass(C).owner as LibraryMirror;
|
var libraryMirror = reflectClass(C).owner;
|
||||||
checkKinds(libraryMirror.declarations[#topGetter],
|
checkKinds(libraryMirror.declarations[#topGetter],
|
||||||
[true, false, true, false, false]);
|
[true, false, true, false, false]);
|
||||||
checkKinds(libraryMirror.declarations[const Symbol("topSetter=")],
|
checkKinds(libraryMirror.declarations[const Symbol("topSetter=")],
|
|
@ -2,9 +2,6 @@
|
||||||
// for details. All rights reserved. Use of this source code is governed by a
|
// 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.
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
library lib;
|
|
||||||
|
|
||||||
@MirrorsUsed(targets: "lib")
|
|
||||||
import "dart:mirrors";
|
import "dart:mirrors";
|
||||||
|
|
||||||
import "package:expect/expect.dart";
|
import "package:expect/expect.dart";
|
14
tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart
Executable file
14
tests/lib_strong/mirrors/method_mirror_source_line_ending_cr.dart
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
// 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() {}
|
|
@ -10,6 +10,5 @@ oneLineCRLF(x) => x;
|
||||||
multiLineCRLF(y) {
|
multiLineCRLF(y) {
|
||||||
return y + 1;
|
return y + 1;
|
||||||
}
|
}
|
||||||
c
|
|
||||||
(){
|
c() {}
|
||||||
}
|
|
|
@ -10,6 +10,5 @@ oneLineLF(x) => x;
|
||||||
multiLineLF(y) {
|
multiLineLF(y) {
|
||||||
return y + 1;
|
return y + 1;
|
||||||
}
|
}
|
||||||
a
|
|
||||||
(){
|
a() {}
|
||||||
}
|
|
|
@ -28,7 +28,6 @@ set x(value) { }
|
||||||
class S {}
|
class S {}
|
||||||
|
|
||||||
class C extends S {
|
class C extends S {
|
||||||
|
|
||||||
var _x;
|
var _x;
|
||||||
var _y;
|
var _y;
|
||||||
|
|
||||||
|
@ -48,52 +47,50 @@ class C extends S {
|
||||||
|
|
||||||
void bar() {/* Not so happy bar. */}
|
void bar() {/* Not so happy bar. */}
|
||||||
|
|
||||||
num get someX =>
|
num get someX => 181;
|
||||||
181;
|
|
||||||
|
|
||||||
set someX(v) {
|
set someX(v) {
|
||||||
// Discard this one.
|
// Discard this one.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
// Top-level members
|
// Top-level members
|
||||||
LibraryMirror lib = reflectClass(C).owner;
|
LibraryMirror lib = reflectClass(C).owner;
|
||||||
expectSource(lib.declarations[#foo1],
|
expectSource(lib.declarations[#foo1], "foo1() {}");
|
||||||
"foo1() {}");
|
expectSource(lib.declarations[#x], "int get x => 42;");
|
||||||
expectSource(lib.declarations[#x],
|
expectSource(lib.declarations[const Symbol("x=")], "set x(value) { }");
|
||||||
"int get x => 42;");
|
|
||||||
expectSource(lib.declarations[const Symbol("x=")],
|
|
||||||
"set x(value) { }");
|
|
||||||
|
|
||||||
// Class members
|
// Class members
|
||||||
ClassMirror cm = reflectClass(C);
|
ClassMirror cm = reflectClass(C);
|
||||||
expectSource(cm.declarations[#foo],
|
expectSource(
|
||||||
|
cm.declarations[#foo],
|
||||||
"static dynamic foo() {\n"
|
"static dynamic foo() {\n"
|
||||||
" // Happy foo.\n"
|
" // Happy foo.\n"
|
||||||
" }");
|
" }");
|
||||||
expectSource(cm.declarations[#bar],
|
expectSource(cm.declarations[#bar], "void bar() { /* Not so happy bar. */ }");
|
||||||
"void bar() { /* Not so happy bar. */ }");
|
expectSource(
|
||||||
expectSource(cm.declarations[#someX],
|
cm.declarations[#someX],
|
||||||
"num get someX =>\n"
|
"num get someX =>\n"
|
||||||
" 181;");
|
" 181;");
|
||||||
expectSource(cm.declarations[const Symbol("someX=")],
|
expectSource(
|
||||||
|
cm.declarations[const Symbol("someX=")],
|
||||||
"set someX(v) {\n"
|
"set someX(v) {\n"
|
||||||
" // Discard this one.\n"
|
" // Discard this one.\n"
|
||||||
" }");
|
" }");
|
||||||
expectSource(cm.declarations[#C],
|
expectSource(
|
||||||
|
cm.declarations[#C],
|
||||||
"C(this._x, y)\n"
|
"C(this._x, y)\n"
|
||||||
" : _y = y,\n"
|
" : _y = y,\n"
|
||||||
" super();");
|
" super();");
|
||||||
expectSource(cm.declarations[#C.other],
|
expectSource(cm.declarations[#C.other], "factory C.other(num z) {}");
|
||||||
"factory C.other(num z) {}");
|
expectSource(cm.declarations[#C.other3], "factory C.other3() = C.other2;");
|
||||||
expectSource(cm.declarations[#C.other3],
|
|
||||||
"factory C.other3() = C.other2;");
|
|
||||||
|
|
||||||
// Closures
|
// Closures
|
||||||
expectSource(reflect(() {}), "(){}");
|
expectSource(reflect(() {}), "(){}");
|
||||||
expectSource(reflect((x,y,z) { return x*y*z; }), "(x,y,z) { return x*y*z; }");
|
expectSource(reflect((x, y, z) {
|
||||||
|
return x * y * z;
|
||||||
|
}), "(x,y,z) { return x*y*z; }");
|
||||||
expectSource(reflect((e) => doSomething(e)), "(e) => doSomething(e)");
|
expectSource(reflect((e) => doSomething(e)), "(e) => doSomething(e)");
|
||||||
|
|
||||||
namedClosure(x, y, z) => 1;
|
namedClosure(x, y, z) => 1;
|
||||||
|
@ -103,7 +100,8 @@ main() {
|
||||||
|
|
||||||
// Function at first line.
|
// Function at first line.
|
||||||
LibraryMirror otherLib = reflectClass(SomethingInOther).owner;
|
LibraryMirror otherLib = reflectClass(SomethingInOther).owner;
|
||||||
expectSource(otherLib.declarations[#main],
|
expectSource(
|
||||||
|
otherLib.declarations[#main],
|
||||||
"""main() {
|
"""main() {
|
||||||
print("Blah");
|
print("Blah");
|
||||||
}""");
|
}""");
|
Loading…
Reference in a new issue