OLD | NEW |
(Empty) | |
| 1 import 'dart:sky' as sky; |
| 2 |
| 3 import '../resources/third_party/unittest/unittest.dart'; |
| 4 import '../resources/unit.dart'; |
| 5 |
| 6 void main() { |
| 7 initUnit(); |
| 8 |
| 9 test("paint set to black", () { |
| 10 sky.Color c = new sky.Color(0x00000000); |
| 11 sky.Paint p = new sky.Paint(); |
| 12 p.color = c; |
| 13 expect(c.toString(), equals('Color(0x00000000)')); |
| 14 }); |
| 15 |
| 16 test("color created with out of bounds value", () { |
| 17 try { |
| 18 sky.Color c = new sky.Color(0x100 << 24); |
| 19 sky.Paint p = new sky.Paint(); |
| 20 p.color = c; |
| 21 } catch (e) { |
| 22 expect(e != null, equals(true)); |
| 23 } |
| 24 }); |
| 25 |
| 26 test("color created with wildly out of bounds value", () { |
| 27 try { |
| 28 sky.Color c = new sky.Color(1 << 1000000); |
| 29 sky.Paint p = new sky.Paint(); |
| 30 p.color = c; |
| 31 } catch (e) { |
| 32 expect(e != null, equals(true)); |
| 33 } |
| 34 }); |
| 35 } |
OLD | NEW |