mirror of
https://github.com/dart-lang/sdk
synced 2024-09-20 06:41:35 +00:00
Updated tests/compiler/* to use new library syntax.
Review URL: https://codereview.chromium.org//11368150 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14748 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
23c2fb6d7c
commit
330ee1eb15
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
foo(a) {
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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("boolified_operator_test.dart");
|
||||
#import("compiler_helper.dart");
|
||||
library boolified_operator_test;
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_EQUAL = r"""
|
||||
foo(param0, param1) {
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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("boolified_operator_test.dart");
|
||||
#import("compiler_helper.dart");
|
||||
library boolified_operator_test;
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST = r"""
|
||||
foo() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST = r"""
|
||||
foo() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
foo(String a) {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// Test that parameters keep their names in the output.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
#import("parser_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
import 'parser_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
class A { foo() => 499; }
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// Test that parameters keep their names in the output.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
#import("parser_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
import 'parser_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
class A { }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// Test that parameters keep their names in the output.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
class A { foo() => 499; }
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// Test that parameters keep their names in the output.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
#import("parser_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
import 'parser_helper.dart';
|
||||
|
||||
const String TEST_INVOCATION0 = r"""
|
||||
main() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
foo(int a, int b, bool param2) {
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
// 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.
|
||||
|
||||
#import("dart:uri");
|
||||
import 'dart:uri';
|
||||
|
||||
#import('compiler_helper.dart');
|
||||
#import('parser_helper.dart');
|
||||
import 'compiler_helper.dart';
|
||||
import 'parser_helper.dart';
|
||||
|
||||
void compileAndFind(String code, String name,
|
||||
check(compiler, element)) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// Test constant folding on numbers.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String NUMBER_FOLDING = """
|
||||
void main() {
|
||||
|
|
|
@ -12,7 +12,7 @@ import '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
|
|||
import '../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart';
|
||||
|
||||
const coreLib = r'''
|
||||
#library('corelib');
|
||||
library corelib;
|
||||
class Object {}
|
||||
interface bool {}
|
||||
interface num {}
|
||||
|
@ -34,14 +34,14 @@ print(x) {}
|
|||
''';
|
||||
|
||||
const ioLib = r'''
|
||||
#library('io');
|
||||
library io;
|
||||
class Platform {
|
||||
static int operatingSystem;
|
||||
}
|
||||
''';
|
||||
|
||||
const htmlLib = r'''
|
||||
#library('html');
|
||||
library html;
|
||||
Window __window;
|
||||
Window get window => __window;
|
||||
abstract class Window {
|
||||
|
@ -53,7 +53,7 @@ abstract class Navigator {
|
|||
''';
|
||||
|
||||
const helperLib = r'''
|
||||
#library('js_helper');
|
||||
library js_helper;
|
||||
class JSInvocationMirror {}
|
||||
''';
|
||||
|
||||
|
@ -183,7 +183,7 @@ testConflictSendsRename() {
|
|||
// everything is renamed correctly in conflicting class names and global
|
||||
// functions.
|
||||
var librarySrc = '''
|
||||
#library("mylib.dart");
|
||||
library mylib;
|
||||
|
||||
globalfoo() {}
|
||||
var globalVar;
|
||||
|
@ -198,7 +198,7 @@ class A {
|
|||
}
|
||||
''';
|
||||
var mainSrc = '''
|
||||
#import("mylib.dart", prefix: "mylib");
|
||||
import 'mylib.dart' as mylib;
|
||||
|
||||
globalfoo() {}
|
||||
var globalVar;
|
||||
|
@ -258,7 +258,7 @@ testNoConflictSendsRename() {
|
|||
// Various Send-s to current library and external library. Nothing should be
|
||||
// renamed here, only library prefixes must be cut.
|
||||
var librarySrc = '''
|
||||
#library("mylib.dart");
|
||||
library mylib;
|
||||
|
||||
globalfoo() {}
|
||||
|
||||
|
@ -271,7 +271,7 @@ class A {
|
|||
}
|
||||
''';
|
||||
var mainSrc = '''
|
||||
#import("mylib.dart", prefix: "mylib");
|
||||
import 'mylib.dart' as mylib;
|
||||
|
||||
myglobalfoo() {}
|
||||
|
||||
|
@ -315,7 +315,7 @@ main() {
|
|||
|
||||
testConflictLibraryClassRename() {
|
||||
var librarySrc = '''
|
||||
#library('mylib');
|
||||
library mylib;
|
||||
|
||||
topfoo() {}
|
||||
|
||||
|
@ -324,7 +324,7 @@ class A {
|
|||
}
|
||||
''';
|
||||
var mainSrc = '''
|
||||
#import('mylib.dart', prefix: 'mylib');
|
||||
import 'mylib.dart' as mylib;
|
||||
|
||||
|
||||
topfoo() {var x = 5;}
|
||||
|
@ -380,13 +380,13 @@ testStaticInvocation() {
|
|||
|
||||
testLibraryGetSet() {
|
||||
var librarySrc = '''
|
||||
#library('mylib');
|
||||
library mylib;
|
||||
|
||||
get topgetset => 5;
|
||||
set topgetset(arg) {}
|
||||
''';
|
||||
var mainSrc = '''
|
||||
#import('mylib.dart', prefix: 'mylib');
|
||||
import 'mylib.dart' as mylib;
|
||||
|
||||
get topgetset => 6;
|
||||
set topgetset(arg) {}
|
||||
|
@ -478,14 +478,14 @@ testTypeVariablesAreRenamed() {
|
|||
// if we have a class and type variable with the same name, they
|
||||
// both should be renamed.
|
||||
var librarySrc = '''
|
||||
#library('mylib');
|
||||
library mylib;
|
||||
typedef void MyFunction<T extends num>(T arg);
|
||||
class T {}
|
||||
class B<T> {}
|
||||
class A<T> extends B<T> { T f; }
|
||||
''';
|
||||
var mainSrc = '''
|
||||
#import('mylib.dart', prefix: 'mylib');
|
||||
import 'mylib.dart' as mylib;
|
||||
typedef void MyFunction<T extends num>(T arg);
|
||||
class T {}
|
||||
class B<T> {}
|
||||
|
@ -518,14 +518,14 @@ main() {
|
|||
|
||||
testClassTypeArgumentBound() {
|
||||
var librarySrc = '''
|
||||
#library('mylib');
|
||||
library mylib;
|
||||
|
||||
interface I {}
|
||||
class A<T extends I> {}
|
||||
|
||||
''';
|
||||
var mainSrc = '''
|
||||
#import('mylib.dart', prefix: 'mylib');
|
||||
import 'mylib.dart' as mylib;
|
||||
|
||||
interface I {}
|
||||
class A<T extends I> {}
|
||||
|
@ -547,11 +547,11 @@ main() {
|
|||
|
||||
testDoubleMains() {
|
||||
var librarySrc = '''
|
||||
#library('mylib');
|
||||
library mylib;
|
||||
main() {}
|
||||
''';
|
||||
var mainSrc = '''
|
||||
#import('mylib.dart', prefix: 'mylib');
|
||||
import 'mylib.dart' as mylib;
|
||||
main() {
|
||||
mylib.main();
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ main() {
|
|||
|
||||
testStaticAccessIoLib() {
|
||||
var src = '''
|
||||
#import('dart:io');
|
||||
import 'dart:io';
|
||||
|
||||
main() {
|
||||
Platform.operatingSystem;
|
||||
|
@ -658,7 +658,7 @@ main() {
|
|||
|
||||
testPlatformLibraryMemberNamesAreFixed() {
|
||||
var src = '''
|
||||
#import('dart:html');
|
||||
import 'dart:html';
|
||||
|
||||
class A {
|
||||
static String get userAgent => window.navigator.userAgent;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
void foo(bar) {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// Test that parameters keep their names in the output.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
#import("parser_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
import 'parser_helper.dart';
|
||||
|
||||
const String TEST_NULL0 = r"""
|
||||
class A { static var x; }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String FIB = r"""
|
||||
fib(n) {
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
// Test that dart2js gvns dynamic getters that don't have side
|
||||
// effects.
|
||||
|
||||
#import('compiler_helper.dart');
|
||||
#import('parser_helper.dart');
|
||||
#import('dart:uri');
|
||||
import 'compiler_helper.dart';
|
||||
import 'parser_helper.dart';
|
||||
import 'dart:uri';
|
||||
|
||||
const String TEST = r"""
|
||||
class A {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
void foo(bar) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
class A {}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String MAIN = r"""
|
||||
int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_IF_BOOL_FIRST_INSTRUCTION = r"""
|
||||
negate(x) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_IF = r"""
|
||||
test(param) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
foo() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
foo(a) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// Test that parameters keep their names in the output.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
main() {
|
||||
var buffer = new StringBuffer();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST = r"""
|
||||
class A {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String CODE = """
|
||||
var x = 0;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String CODE = """
|
||||
class A {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST = r"""
|
||||
class A {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
foo() {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
// VMOptions=--enable_asserts
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String SOURCE = r"""
|
||||
bool baz(int a, int b) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// Test that parameters keep their names in the output.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String FOO = r"""
|
||||
void foo(var a, var b) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
void foo(bar) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// Test that we get rid of duplicate type guards on a field when that
|
||||
// field is being gvn'ed.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST = r"""
|
||||
class A {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
// Test that parameters keep their names in the output.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
void foo(bar) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
// Test that static functions are closurized as expected.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
main() {
|
||||
String code = compileAll(r'''main() { print(main); }''');
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
// Test that the compiler handles string literals containing line terminators.
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
main() {
|
||||
String code =
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import('compiler_helper.dart');
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST = r"""
|
||||
class A {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
foo(a) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
sum(param0, param1) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
sum(param0, param1) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
foo(j) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
foo(j) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const String TEST_ONE = r"""
|
||||
sum(a, b) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import("compiler_helper.dart");
|
||||
import 'compiler_helper.dart';
|
||||
|
||||
const int REMOVED = 0;
|
||||
const int ABOVE_ZERO = 1;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#source('inline_position_crash_source.dart');
|
||||
part 'inline_position_crash_source.dart';
|
||||
|
||||
class Sub extends Super {
|
||||
Sub() : super();
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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("math_lib_prefix_test");
|
||||
#import("dart:math", prefix: "foo");
|
||||
library math_lib_prefix_test;
|
||||
import 'dart:math' as foo;
|
||||
|
||||
main() {
|
||||
Expect.equals(2.0, foo.sqrt(4));
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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("math_lib_test");
|
||||
#import("dart:math");
|
||||
library math_lib_test;
|
||||
import 'dart:math';
|
||||
|
||||
main() {
|
||||
Expect.equals(2.0, sqrt(4));
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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("panda_lib");
|
||||
library panda_lib;
|
||||
|
||||
class Panda {
|
||||
Panda() {
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// 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("panda_test");
|
||||
#import("panda_lib.dart", prefix:"p");
|
||||
library panda_test;
|
||||
import 'panda_lib.dart' as p;
|
||||
|
||||
void main() {
|
||||
p.Panda x = new p.Panda();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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_a");
|
||||
library lib_a;
|
||||
|
||||
class A {
|
||||
x(A a) => a._x;
|
||||
|
|
|
@ -2,9 +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_b");
|
||||
library lib_b;
|
||||
|
||||
#import("4434_lib.dart");
|
||||
import '4434_lib.dart';
|
||||
|
||||
class B extends A { }
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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('4740_library');
|
||||
library 4740_library;
|
||||
|
||||
class Foo {
|
||||
Foo._internal();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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.
|
||||
|
||||
#import('4740_library.dart');
|
||||
import '4740_library.dart';
|
||||
|
||||
main() {
|
||||
Expect.throws(() => new Foo._internal(), (e) => e is NoSuchMethodError);
|
||||
|
|
|
@ -2,9 +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('source_mapping_crash_test');
|
||||
library source_mapping_crash_test;
|
||||
|
||||
#source('source_mapping_crash_source.dart');
|
||||
part 'source_mapping_crash_source.dart';
|
||||
|
||||
class Sub extends Super {
|
||||
Sub(var x) : super(x.y);
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
// 'I' is the name of an interface and the name of the native class.
|
||||
|
||||
#library('native_library_same_name_used_lib1.dart');
|
||||
library native_library_same_name_used_lib1;
|
||||
|
||||
#import('native_library_same_name_used_lib2.dart');
|
||||
import 'native_library_same_name_used_lib2.dart';
|
||||
|
||||
interface I {
|
||||
I read();
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
// Native implementation.
|
||||
|
||||
#library('lib2');
|
||||
#import('native_library_same_name_used_lib1.dart'); // To get interface I.
|
||||
library lib2;
|
||||
import 'native_library_same_name_used_lib1.dart'; // To get interface I.
|
||||
|
||||
// Native impl has same name as interface.
|
||||
@native("*I")
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
// Test for correct hidden native class when interface has same name.
|
||||
|
||||
#library('main');
|
||||
#import('native_library_same_name_used_lib1.dart');
|
||||
library main;
|
||||
import 'native_library_same_name_used_lib1.dart';
|
||||
|
||||
@native("""
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
// Test for correct hidden native class when interface has same name.
|
||||
|
||||
#library('main');
|
||||
#import('native_library_same_name_used_lib1.dart');
|
||||
library main;
|
||||
import 'native_library_same_name_used_lib1.dart';
|
||||
|
||||
void setup() native """
|
||||
// This code is all inside 'setup' and so not accesible from the global scope.
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
// 'I' is the name of an interface and the name of the native class.
|
||||
|
||||
#library('native_library_same_name_used_lib1.dart');
|
||||
library native_library_same_name_used_lib1;
|
||||
|
||||
#import('native_library_same_name_used_lib2.dart');
|
||||
import 'native_library_same_name_used_lib2.dart';
|
||||
|
||||
interface I {
|
||||
I read();
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
// Native implementation.
|
||||
|
||||
#library('lib2');
|
||||
#import('native_library_same_name_used_lib1.dart'); // To get interface I.
|
||||
library lib2;
|
||||
import 'native_library_same_name_used_lib1.dart'; // To get interface I.
|
||||
|
||||
// Native impl has same name as interface.
|
||||
class Impl implements I native "*I" {
|
||||
|
|
Loading…
Reference in a new issue