OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 import 'package:test/test.dart'; |
| 6 |
| 7 import 'helper.dart' show check; |
| 8 |
| 9 main() { |
| 10 group('compile getters with kernel', () { |
| 11 test('top-level', () { |
| 12 String code = ''' |
| 13 int get foo => 1; |
| 14 main() => foo; |
| 15 '''; |
| 16 return check(code); |
| 17 }); |
| 18 |
| 19 test('static', () { |
| 20 String code = ''' |
| 21 class A { |
| 22 static int get foo => 1; |
| 23 } |
| 24 main() => A.foo; |
| 25 '''; |
| 26 return check(code); |
| 27 }); |
| 28 }); |
| 29 |
| 30 group('compile setters with kernel', () { |
| 31 test('top-level', () { |
| 32 String code = ''' |
| 33 set foo(int newFoo) { |
| 34 // do nothing |
| 35 } |
| 36 main() { |
| 37 foo = 1; |
| 38 }'''; |
| 39 return check(code); |
| 40 }); |
| 41 |
| 42 test('static', () { |
| 43 String code = ''' |
| 44 class A { |
| 45 static set foo(int newFoo) { |
| 46 // do nothing |
| 47 } |
| 48 } |
| 49 main() { |
| 50 A.foo = 1; |
| 51 } |
| 52 '''; |
| 53 return check(code); |
| 54 }); |
| 55 }); |
| 56 } |
OLD | NEW |