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.numberOfLeadingZeros.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbracken committed Feb 11, 2015
1 parent 5b45107 commit 1164037
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/int32_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ void main() {
});
});

group("leading/trailing zeros", () {
test("numberOfLeadingZeros", () {
expect(new Int32(0).numberOfLeadingZeros(), 32);
expect(new Int32(1).numberOfLeadingZeros(), 31);
expect(new Int32(0xffff).numberOfLeadingZeros(), 16);
expect(new Int32(-1).numberOfLeadingZeros(), 0);
});
});

group("comparison operators", () {
test("compareTo", () {
expect(new Int32(0).compareTo(-1), 1);
Expand Down

0 comments on commit 1164037

Please sign in to comment.