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

Unified Diff: tests/compiler/dart2js/number_output_test.dart

Issue 938383005: Extends shortened representation of numbers to negative numbers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 | « pkg/compiler/lib/src/js_backend/constant_emitter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/number_output_test.dart
diff --git a/tests/compiler/dart2js/number_output_test.dart b/tests/compiler/dart2js/number_output_test.dart
index 5402e1372931dc1f42cb31d1f2a06f07dbe2d740..6ced21cd38b3bad28d65f22a1da7a0551ad90cbf 100644
--- a/tests/compiler/dart2js/number_output_test.dart
+++ b/tests/compiler/dart2js/number_output_test.dart
@@ -12,6 +12,7 @@ const MEMORY_SOURCE_FILES = const {
print(12300000);
print(1234567890123456789012345);
print(double.MAX_FINITE);
+ print(-22230000);
}'''};
void test({bool minify}) {
@@ -22,12 +23,16 @@ void test({bool minify}) {
asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
// Check that we use the shorter exponential representations.
String jsOutput = collector.getOutput('', 'js');
+ print(jsOutput);
if (minify) {
Expect.isTrue(jsOutput.contains('123e5')); // Shorter than 12300000.
Expect.isFalse(jsOutput.contains('12300000'));
+ Expect.isTrue(jsOutput.contains('-2223e4')); // Shorter than -22230000.
+ Expect.isFalse(jsOutput.contains('-22230000'));
} else {
Expect.isTrue(jsOutput.contains('12300000'));
+ Expect.isTrue(jsOutput.contains('-22230000'));
}
Expect.isTrue(jsOutput.contains('12345678901234568e8'));
Expect.isTrue(jsOutput.contains('17976931348623157e292'));
« no previous file with comments | « pkg/compiler/lib/src/js_backend/constant_emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698