Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: test/dart_codegen/expect/core/date_time.dart

Issue 959073002: Fix new line breaks on } (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/dart_codegen/expect/convert/utf.dart ('k') | test/dart_codegen/expect/core/duration.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/dart_codegen/expect/core/date_time.dart
diff --git a/test/dart_codegen/expect/core/date_time.dart b/test/dart_codegen/expect/core/date_time.dart
index c3660b842c6e02bb7ab6153bc14b77f025ad6c01..60b399bc0366a8da3ef99f7c3539e371d6384f1a 100644
--- a/test/dart_codegen/expect/core/date_time.dart
+++ b/test/dart_codegen/expect/core/date_time.dart
@@ -109,81 +109,68 @@ part of dart.core;
int absN = n.abs();
String sign = n < 0 ? "-" : "";
if (absN >= 1000) return "$n";
- if (absN >= 100) return "${sign}
-0$absN";
- if (absN >= 10) return "${sign}
-00$absN";
- return "${sign}
-000$absN";
-}
+ if (absN >= 100) return "${sign}0$absN";
+ if (absN >= 10) return "${sign}00$absN";
+ return "${sign}000$absN";
+ }
static String _sixDigits(int n) {
-assert (n < -9999 || n > 9999); int absN = n.abs();
- String sign = n < 0 ? "-" : "+";
- if (absN >= 100000) return "$sign$absN";
- return "${sign}
-0$absN";
-}
+ assert (n < -9999 || n > 9999); int absN = n.abs();
+ String sign = n < 0 ? "-" : "+";
+ if (absN >= 100000) return "$sign$absN";
+ return "${sign}0$absN";
+ }
static String _threeDigits(int n) {
-if (n >= 100) return "${n}
-";
- if (n >= 10) return "0${n}
-";
- return "00${n}
-";
-}
+ if (n >= 100) return "${n}";
+ if (n >= 10) return "0${n}";
+ return "00${n}";
+ }
static String _twoDigits(int n) {
-if (n >= 10) return "${n}
-";
- return "0${n}
-";
-}
+ if (n >= 10) return "${n}";
+ return "0${n}";
+ }
String toString() {
-String y = _fourDigits(year);
- String m = _twoDigits(month);
- String d = _twoDigits(day);
- String h = _twoDigits(hour);
- String min = _twoDigits(minute);
- String sec = _twoDigits(second);
- String ms = _threeDigits(millisecond);
- if (isUtc) {
-return "$y-$m-$d $h:$min:$sec.${ms}
-Z";
-}
- else {
-return "$y-$m-$d $h:$min:$sec.$ms";
-}
-}
+ String y = _fourDigits(year);
+ String m = _twoDigits(month);
+ String d = _twoDigits(day);
+ String h = _twoDigits(hour);
+ String min = _twoDigits(minute);
+ String sec = _twoDigits(second);
+ String ms = _threeDigits(millisecond);
+ if (isUtc) {
+ return "$y-$m-$d $h:$min:$sec.${ms}Z";
+ }
+ else {
+ return "$y-$m-$d $h:$min:$sec.$ms";
+ }
+ }
String toIso8601String() {
-String y = (year >= -9999 && year <= 9999) ? _fourDigits(year) : _sixDigits(year);
- String m = _twoDigits(month);
- String d = _twoDigits(day);
- String h = _twoDigits(hour);
- String min = _twoDigits(minute);
- String sec = _twoDigits(second);
- String ms = _threeDigits(millisecond);
- if (isUtc) {
-return "$y-$m-${d}
-T$h:$min:$sec.${ms}
-Z";
-}
- else {
-return "$y-$m-${d}
-T$h:$min:$sec.$ms";
-}
-}
+ String y = (year >= -9999 && year <= 9999) ? _fourDigits(year) : _sixDigits(year);
+ String m = _twoDigits(month);
+ String d = _twoDigits(day);
+ String h = _twoDigits(hour);
+ String min = _twoDigits(minute);
+ String sec = _twoDigits(second);
+ String ms = _threeDigits(millisecond);
+ if (isUtc) {
+ return "$y-$m-${d}T$h:$min:$sec.${ms}Z";
+ }
+ else {
+ return "$y-$m-${d}T$h:$min:$sec.$ms";
+ }
+ }
DateTime add(Duration duration) {
-int ms = millisecondsSinceEpoch;
- return new DateTime.fromMillisecondsSinceEpoch(ms + duration.inMilliseconds, isUtc: isUtc);
-}
+ int ms = millisecondsSinceEpoch;
+ return new DateTime.fromMillisecondsSinceEpoch(ms + duration.inMilliseconds, isUtc: isUtc);
+ }
DateTime subtract(Duration duration) {
-int ms = millisecondsSinceEpoch;
- return new DateTime.fromMillisecondsSinceEpoch(ms - duration.inMilliseconds, isUtc: isUtc);
-}
+ int ms = millisecondsSinceEpoch;
+ return new DateTime.fromMillisecondsSinceEpoch(ms - duration.inMilliseconds, isUtc: isUtc);
+ }
Duration difference(DateTime other) {
-int ms = millisecondsSinceEpoch;
- int otherMs = other.millisecondsSinceEpoch;
- return new Duration(milliseconds: ms - otherMs);
-}
+ int ms = millisecondsSinceEpoch;
+ int otherMs = other.millisecondsSinceEpoch;
+ return new Duration(milliseconds: ms - otherMs);
+ }
external DateTime._internal(int year, int month, int day, int hour, int minute, int second, int millisecond, bool isUtc);
external DateTime._now();
external static int _brokenDownDateToMillisecondsSinceEpoch(int year, int month, int day, int hour, int minute, int second, int millisecond, bool isUtc);
« no previous file with comments | « test/dart_codegen/expect/convert/utf.dart ('k') | test/dart_codegen/expect/core/duration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698