Skip to content

Commit

Permalink
Merge pull request flutter#6 from dart-lang/fix-dart-2
Browse files Browse the repository at this point in the history
Fix to use lowercase Dart 2 core library constant names.
  • Loading branch information
munificent authored Jul 13, 2018
2 parents 0e339e4 + f3fcaf9 commit b703d0c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ language: dart

dart:
- dev
- stable

# See https://docs.travis-ci.com/user/languages/dart/ for details.
dart_task:
Expand All @@ -19,10 +18,9 @@ dart_task:
# them against each Dart version.
matrix:
include:
- dart: stable
dart_task: dartfmt
- dart: dev
dart_task: dartanalyzer
dart_task: dartfmt

# Only building master means that we don't run two builds for each pull request.
branches:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.1

* Update to lowercase Dart core library constants.

## 1.0.0

This release contains the `Clock` class that was defined in [`quiver`][]. It's
Expand Down
2 changes: 0 additions & 2 deletions analysis_options.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const _daysInMonth = const [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
/// This function assumes the use of the Gregorian calendar or the proleptic
/// Gregorian calendar.
int daysInMonth(int year, int month) =>
(month == DateTime.FEBRUARY && isLeapYear(year)) ? 29 : _daysInMonth[month];
(month == DateTime.february && isLeapYear(year)) ? 29 : _daysInMonth[month];

/// Returns true if [year] is a leap year.
///
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: clock
version: 1.0.0
version: 1.0.1
description: A fakeable wrapper for dart:core clock APIs
author: Dart Team <[email protected]>
homepage: https://github.com/dart-lang/clock

environment:
sdk: '>=1.24.0 <2.0.0'
sdk: '>=2.0.0-dev.36.0 <3.0.0'

dependencies:
meta: '>=0.9.0 <2.0.0'
Expand Down
10 changes: 5 additions & 5 deletions test/stopwatch_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ void main() {
test("stop() does nothing", () {
stopwatch.stop();
expect(stopwatch.isRunning, isFalse);
expect(stopwatch.elapsed, equals(Duration.ZERO));
expect(stopwatch.elapsed, equals(Duration.zero));
});

group("reports no elapsed", () {
test("duration", () => expect(stopwatch.elapsed, equals(Duration.ZERO)));
test("duration", () => expect(stopwatch.elapsed, equals(Duration.zero)));
test("ticks", () => expect(stopwatch.elapsedTicks, isZero));
test("microseconds", () => expect(stopwatch.elapsedMicroseconds, isZero));
test("milliseconds", () => expect(stopwatch.elapsedMilliseconds, isZero));
Expand Down Expand Up @@ -79,7 +79,7 @@ void main() {
});

test("sets the elapsed time to zero", () {
expect(stopwatch.elapsed, equals(Duration.ZERO));
expect(stopwatch.elapsed, equals(Duration.zero));
});

test("reports more elapsed time", () {
Expand Down Expand Up @@ -135,12 +135,12 @@ void main() {
});

test("sets the elapsed time to zero", () {
expect(stopwatch.elapsed, equals(Duration.ZERO));
expect(stopwatch.elapsed, equals(Duration.zero));
});

test("doesn't report more elapsed time", () {
time = clock.microsFromNow(54321);
expect(stopwatch.elapsed, equals(Duration.ZERO));
expect(stopwatch.elapsed, equals(Duration.zero));
});
});

Expand Down

0 comments on commit b703d0c

Please sign in to comment.