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 import "dart:_js_helper"; |
5 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
6 | 7 |
7 // Test for values of some basic types. | 8 // Test for values of some basic types. |
8 | 9 |
9 | 10 |
10 class A native "A" { | 11 @Native("A") |
| 12 class A { |
11 returnNull() native; | 13 returnNull() native; |
12 returnUndefined() native; | 14 returnUndefined() native; |
13 returnEmptyString() native; | 15 returnEmptyString() native; |
14 returnZero() native; | 16 returnZero() native; |
15 } | 17 } |
16 | 18 |
17 A makeA() native; | 19 A makeA() native; |
18 | 20 |
19 void setup() native """ | 21 void setup() native """ |
20 function A() {} | 22 function A() {} |
(...skipping 11 matching lines...) Expand all Loading... |
32 Expect.equals(null, a.returnNull()); | 34 Expect.equals(null, a.returnNull()); |
33 Expect.equals(null, a.returnUndefined()); | 35 Expect.equals(null, a.returnUndefined()); |
34 | 36 |
35 Expect.equals('', a.returnEmptyString()); | 37 Expect.equals('', a.returnEmptyString()); |
36 Expect.isTrue(a.returnEmptyString().isEmpty); | 38 Expect.isTrue(a.returnEmptyString().isEmpty); |
37 Expect.isTrue(a.returnEmptyString() is String); | 39 Expect.isTrue(a.returnEmptyString() is String); |
38 | 40 |
39 Expect.isTrue(a.returnZero() is int); | 41 Expect.isTrue(a.returnZero() is int); |
40 Expect.equals(0, a.returnZero()); | 42 Expect.equals(0, a.returnZero()); |
41 } | 43 } |
OLD | NEW |