OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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 'package:test/test.dart'; | 5 import 'package:test/test.dart'; |
6 | 6 |
7 import 'helper.dart' show check; | 7 import 'helper.dart' show check; |
8 | 8 |
9 main() { | 9 main() { |
10 group('compile binary operators', () { | 10 group('compile binary operators', () { |
11 test('plus on ints', () { | 11 test('plus on ints', () { |
12 return check('main() { return 1 + 2; }'); | 12 return check('main() { return 1 + 2; }'); |
13 }); | 13 }); |
| 14 test('plus on strings', () { |
| 15 return check('main() { return "a" + "b"; }'); |
| 16 }); |
| 17 test('plus on non-constants', () { |
| 18 String code = ''' |
| 19 foo() => 1; |
| 20 main() => foo() + foo();'''; |
| 21 return check(code); |
| 22 }); |
| 23 test('other arithmetic operators', () { |
| 24 return check('main() { return 1 + 2 * 3 - 4 / 5 % 6; }'); |
| 25 }); |
14 }); | 26 }); |
15 } | 27 } |
OLD | NEW |