| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #import('dart:uri'); | 5 #import('dart:uri'); |
| 6 #import('parser_helper.dart'); | 6 #import('parser_helper.dart'); |
| 7 #import("../../../lib/compiler/compiler.dart"); | 7 #import("../../../lib/compiler/compiler.dart"); |
| 8 #import("../../../lib/compiler/implementation/tree/tree.dart"); | 8 #import("../../../lib/compiler/implementation/tree/tree.dart"); |
| 9 | 9 |
| 10 testUnparse(String statement) { | 10 testUnparse(String statement) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 testIndexedOperatorDecl() { | 81 testIndexedOperatorDecl() { |
| 82 testUnparseMember('operator[](int i)=> null;'); | 82 testUnparseMember('operator[](int i)=> null;'); |
| 83 } | 83 } |
| 84 | 84 |
| 85 testNativeMethods() { | 85 testNativeMethods() { |
| 86 testUnparseMember('foo()native;'); | 86 testUnparseMember('foo()native;'); |
| 87 testUnparseMember('foo()native "bar";'); | 87 testUnparseMember('foo()native "bar";'); |
| 88 testUnparseMember('foo()native "this.x = 41";'); | 88 testUnparseMember('foo()native "this.x = 41";'); |
| 89 } | 89 } |
| 90 | 90 |
| 91 testPrefixIncrements() { |
| 92 testUnparse('++i;'); |
| 93 testUnparse('++a[i];'); |
| 94 testUnparse('++a[++b[i]];'); |
| 95 } |
| 96 |
| 91 testSimpleFileUnparse() { | 97 testSimpleFileUnparse() { |
| 92 final src = ''' | 98 final src = ''' |
| 93 should_be_dropped() { | 99 should_be_dropped() { |
| 94 } | 100 } |
| 95 | 101 |
| 96 should_be_kept() { | 102 should_be_kept() { |
| 97 } | 103 } |
| 98 | 104 |
| 99 main() { | 105 main() { |
| 100 should_be_kept(); | 106 should_be_kept(); |
| 101 } | 107 } |
| 102 '''; | 108 '''; |
| 103 testDart2Dart(src, (String s) { | 109 testDart2Dart(src, (String s) { |
| 104 Expect.equals('should_be_kept(){}main(){should_be_kept();}', s); | 110 Expect.equals('should_be_kept(){}main(){should_be_kept();}', s); |
| 105 }); | 111 }); |
| 106 } | 112 } |
| 107 | 113 |
| 108 main() { | 114 main() { |
| 109 testGenericTypes(); | 115 testGenericTypes(); |
| 110 testForLoop(); | 116 testForLoop(); |
| 111 testEmptyList(); | 117 testEmptyList(); |
| 112 testClosure(); | 118 testClosure(); |
| 113 testIndexedOperatorDecl(); | 119 testIndexedOperatorDecl(); |
| 114 testNativeMethods(); | 120 testNativeMethods(); |
| 121 testPrefixIncrements(); |
| 115 testSimpleFileUnparse(); | 122 testSimpleFileUnparse(); |
| 116 } | 123 } |
| OLD | NEW |