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:
gram@google.com 2012-11-09 18:39:05 +00:00
parent 23c2fb6d7c
commit 330ee1eb15
62 changed files with 102 additions and 102 deletions

View file

@ -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) {

View file

@ -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) {

View file

@ -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() {

View file

@ -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() {

View file

@ -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) {

View file

@ -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; }

View file

@ -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 { }

View file

@ -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; }

View file

@ -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() {

View file

@ -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) {

View file

@ -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)) {

View file

@ -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() {

View file

@ -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;

View file

@ -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) {

View file

@ -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; }

View file

@ -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) {

View file

@ -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 {

View file

@ -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) {

View file

@ -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 {}

View file

@ -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));

View file

@ -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) {

View file

@ -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) {

View file

@ -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() {

View file

@ -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) {

View file

@ -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();

View file

@ -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 {

View file

@ -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;

View file

@ -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 {

View file

@ -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 {

View file

@ -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() {

View file

@ -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) {

View file

@ -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) {

View file

@ -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) {

View file

@ -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 {

View file

@ -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) {

View file

@ -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); }''');

View file

@ -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.

View file

@ -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 =

View file

@ -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 {

View file

@ -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) {

View file

@ -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) {

View file

@ -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) {

View file

@ -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) {

View file

@ -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) {

View file

@ -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) {

View file

@ -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;

View file

@ -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();

View file

@ -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));

View file

@ -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));

View file

@ -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() {

View file

@ -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();

View file

@ -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;

View file

@ -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 { }

View file

@ -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();

View file

@ -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);

View file

@ -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);

View file

@ -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();

View file

@ -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")

View file

@ -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.

View file

@ -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.

View file

@ -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();

View file

@ -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" {