OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 package com.google.dart.compiler.resolver; | 5 package com.google.dart.compiler.resolver; |
6 | 6 |
7 import com.google.dart.compiler.CompilerTestCase; | 7 import com.google.dart.compiler.CompilerTestCase; |
8 import com.google.dart.compiler.DartCompilationError; | 8 import com.google.dart.compiler.DartCompilationError; |
9 import com.google.dart.compiler.ast.DartUnit; | 9 import com.google.dart.compiler.ast.DartUnit; |
10 import com.google.dart.compiler.testing.TestCompilerContext; | 10 import com.google.dart.compiler.testing.TestCompilerContext; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 public void testArrayLiteralNegativeTest() { | 82 public void testArrayLiteralNegativeTest() { |
83 checkSourceErrors( | 83 checkSourceErrors( |
84 makeCode( | 84 makeCode( |
85 "class A {", | 85 "class A {", |
86 " main() {", | 86 " main() {", |
87 " List<int, int> ints = [1];", | 87 " List<int, int> ints = [1];", |
88 " }", | 88 " }", |
89 "}"), | 89 "}"), |
90 errEx(TypeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 3, 5, 14)); | 90 errEx(TypeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 3, 5, 14)); |
91 } | 91 } |
92 | 92 |
93 public void testMapLiteralNegativeTest() { | 93 public void testMapLiteralNegativeTest() { |
94 checkSourceErrors( | 94 checkSourceErrors( |
95 makeCode( | 95 makeCode( |
96 "class A {", | 96 "class A {", |
97 " main() {", | 97 " main() {", |
98 " Map<String, int, int> map = {'foo':1};", | 98 " Map<String, int, int> map = {'foo':1};", |
99 " }", | 99 " }", |
100 "}"), | 100 "}"), |
101 errEx(TypeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 3, 5, 21)); | 101 errEx(TypeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 3, 5, 21)); |
102 } | 102 } |
103 | 103 |
104 public void testCall1() { | 104 public void testCall1() { |
105 checkNumErrors("StaticInstanceCallNegativeTest.dart", 1); | 105 checkNumErrors("StaticInstanceCallNegativeTest.dart", 1); |
106 } | 106 } |
107 | 107 |
108 public void testClassExtendsInterfaceNegativeTest() { | 108 public void testClassExtendsInterfaceNegativeTest() { |
109 checkNumErrors("ClassExtendsInterfaceNegativeTest.dart", 1); | 109 checkNumErrors("ClassExtendsInterfaceNegativeTest.dart", 1); |
110 } | 110 } |
111 | 111 |
112 public void tesClassImplementsUnknownInterfaceNegativeTest() { | 112 public void tesClassImplementsUnknownInterfaceNegativeTest() { |
113 checkNumErrors("ClassImplementsUnknownInterfaceNegativeTest.dart", 1); | 113 checkNumErrors("ClassImplementsUnknownInterfaceNegativeTest.dart", 1); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 private TestCompilerContext getContext() { | 224 private TestCompilerContext getContext() { |
225 return new TestCompilerContext() { | 225 return new TestCompilerContext() { |
226 @Override | 226 @Override |
227 public void onError(DartCompilationError event) { | 227 public void onError(DartCompilationError event) { |
228 errors.add(event); | 228 errors.add(event); |
229 } | 229 } |
230 }; | 230 }; |
231 } | 231 } |
232 } | 232 } |
OLD | NEW |