Skip to content
This repository has been archived by the owner on Nov 9, 2018. It is now read-only.

Commit

Permalink
Merge pull request #12 from dart-lang/infinity
Browse files Browse the repository at this point in the history
fix an issue with double.INFINITY
  • Loading branch information
devoncarew authored Mar 28, 2018
2 parents c3b8190 + 4a12aec commit e8977c1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 1.0.0
## 1.0.0+1
* Fix an issue with converting `double.INFINITY`.

## 1.0.0
* Initial version.
10 changes: 5 additions & 5 deletions lib/src/changes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ final Map<String, String> _textReplacements = {
'DateTime.DECEMBER': 'DateTime.december',
'DateTime.MONTHS_PER_YEAR': 'DateTime.monthsPerYear',

'double.NAN': 'DateTime.nan',
'double.INFINITY': 'DateTime.infinity',
'double.NEGATIVE_INFINITY': 'DateTime.negativeInfinity',
'double.MIN_POSITIVE': 'DateTime.minPositive',
'double.MAX_FINITE': 'DateTime.maxFinite',
'double.NAN': 'double.nan',
'double.INFINITY': 'double.infinity',
'double.NEGATIVE_INFINITY': 'double.negativeInfinity',
'double.MIN_POSITIVE': 'double.minPositive',
'double.MAX_FINITE': 'double.maxFinite',

'Duration.MICROSECONDS_PER_MILLISECOND':
'Duration.microsecondsPerMillisecond',
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: dart2_fix
author: Dart Team <[email protected]>
description: A tool to migrate API usage to Dart 2.
homepage: https://github.com/dart-lang/dart2_fix
version: 1.0.0
version: 1.0.0+1

environment:
sdk: '>=1.20.1 <2.0.0'
Expand Down
1 change: 1 addition & 0 deletions test/data/sample.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ void main() {
print(PI); // dart:math
print(JSON); // dart:convert
print(Duration.ZERO); // dart:core
print(double.INFINITY); // dart:core
}
17 changes: 12 additions & 5 deletions test/integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ void main() {
expect(result.result, 0);

String out = logger.stdOutput.toString();
expect(out, contains('line 5 • PI => pi'));
expect(out, contains('line 6 • JSON => json'));
expect(out, contains('line 7 • Duration.ZERO => Duration.zero'));
expect(out, contains('Found 3 fixes'));
expect(out, contains('line 5 - PI => pi'));
expect(out, contains('line 6 - JSON => json'));
expect(out, contains('line 7 - Duration.ZERO => Duration.zero'));
expect(out, contains('line 8 - double.INFINITY => double.infinity'));
expect(out, contains('Found 4 fixes'));
});
});
}
Expand All @@ -33,7 +34,7 @@ class BufferLogger implements Logger {

BufferLogger() {}

final Ansi ansi = new Ansi(false);
final Ansi ansi = new TestAnsi();

void flush() {}

Expand Down Expand Up @@ -73,3 +74,9 @@ class _SimpleProgress implements Progress {

void finish({String message, bool showTiming}) {}
}

class TestAnsi extends Ansi {
TestAnsi() : super(false);

String get bullet => '-';
}

0 comments on commit e8977c1

Please sign in to comment.