Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Add tests for Int32.toBytes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbracken committed Feb 11, 2015
1 parent e7c6d34 commit a894ee2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/int32_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ void main() {
expect(new Int32(17).toInt64(), new Int64(17));
expect(new Int32(-17).toInt64(), new Int64(-17));
});
test("toBytes", () {
expect(new Int32(0).toBytes(), [ 0, 0, 0, 0 ]);
expect(new Int32(0x01020304).toBytes(), [ 4, 3, 2, 1 ]);
expect(new Int32(0x04030201).toBytes(), [ 1, 2, 3, 4 ]);
expect(new Int32(-1).toBytes(), [ 0xff, 0xff, 0xff, 0xff ]);
});
});

group("parse", () {
Expand Down

0 comments on commit a894ee2

Please sign in to comment.