Skip to content

Commit

Permalink
remove some unnecessary casts from tests (flutter#65)
Browse files Browse the repository at this point in the history
* remove some unnecessary casts from tests

* update pubspec/changelog for next dev release
  • Loading branch information
jakemac53 authored Aug 28, 2020
1 parent 0b7accb commit 16d3890
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 1.0.0-nullsafety.1-dev

## 1.0.0-nullsafety

* Migrate to null safety.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: fixnum
version: 1.0.0-nullsafety
version: 1.0.0-nullsafety.1-dev

description: >-
Library for 32- and 64-bit signed fixed-width integers with consistent
Expand Down
10 changes: 5 additions & 5 deletions test/int32_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ void main() {

test('remainder', () {
expect(Int32(0x12345678).remainder(Int32(0x22)),
Int32(0x12345678.remainder(0x22) as int));
Int32(0x12345678.remainder(0x22)));
expect(Int32(0x12345678).remainder(Int32(-0x22)),
Int32(0x12345678.remainder(-0x22) as int));
Int32(0x12345678.remainder(-0x22)));
expect(Int32(-0x12345678).remainder(Int32(-0x22)),
Int32(-0x12345678.remainder(-0x22) as int));
Int32(-0x12345678.remainder(-0x22)));
expect(Int32(-0x12345678).remainder(Int32(0x22)),
Int32(-0x12345678.remainder(0x22) as int));
Int32(-0x12345678.remainder(0x22)));
expect(Int32(0x12345678).remainder(Int64(0x22)),
Int32(0x12345678.remainder(0x22) as int));
Int32(0x12345678.remainder(0x22)));
});

test('abs', () {
Expand Down
10 changes: 5 additions & 5 deletions test/int64_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,15 @@ void main() {
expect(Int64.MAX_VALUE % Int64.fromInts(0x04000000, 0x00000000),
Int64.fromInts(0x3ffffff, 0xffffffff));
expect(Int64(0x12345678).remainder(Int64(0x22)),
Int64(0x12345678.remainder(0x22) as int));
Int64(0x12345678.remainder(0x22)));
expect(Int64(0x12345678).remainder(Int64(-0x22)),
Int64(0x12345678.remainder(-0x22) as int));
Int64(0x12345678.remainder(-0x22)));
expect(Int64(-0x12345678).remainder(Int64(-0x22)),
Int64(-0x12345678.remainder(-0x22) as int));
Int64(-0x12345678.remainder(-0x22)));
expect(Int64(-0x12345678).remainder(Int64(0x22)),
Int64(-0x12345678.remainder(0x22) as int));
Int64(-0x12345678.remainder(0x22)));
expect(Int32(0x12345678).remainder(Int64(0x22)),
Int64(0x12345678.remainder(0x22) as int));
Int64(0x12345678.remainder(0x22)));
argumentErrorTest('%', (a, b) => a % b);
});

Expand Down

0 comments on commit 16d3890

Please sign in to comment.