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

Unified Diff: test/browser/language_tests.js

Issue 1950133008: Update number parsing. (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 years, 7 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 | « lib/runtime/dart_sdk.js ('k') | test/codegen/corelib/int_parse_radix_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/browser/language_tests.js
diff --git a/test/browser/language_tests.js b/test/browser/language_tests.js
index 00c491600d2455e4b1b9f6676fd0e630b7ab6819..1e1acb8556e2e7af1025d5092fdf52d32fb52678 100644
--- a/test/browser/language_tests.js
+++ b/test/browser/language_tests.js
@@ -15,6 +15,7 @@
// 'skip' - don't run the test
// 'fail' - test fails
// 'timeout' - test times out
+ // 'slow' - use 5s timeout instead of default 2s.
// 'helper' - not a test, used by other tests.
// 'unittest' - run separately as a unittest test.
//
@@ -414,6 +415,9 @@
'int_modulo_arith_test_bignum_multi': fail,
'int_modulo_arith_test_modPow_multi': fail,
'int_modulo_arith_test_none_multi': fail,
+ 'int_parse_radix_test_01_multi': fail, // JS implementations disagree on U+0085 being whitespace.
+ 'int_parse_radix_test_02_multi': ['fail', 'timeout', 'skip'], // No bigints.
+ 'int_parse_radix_test_none_multi': ['slow'],
'integer_to_radix_string_test': fail,
'integer_to_string_test_01_multi': fail,
'iterable_generate_test': fail,
@@ -517,17 +521,41 @@
continue;
}
- test(name, (done) => {
+ function protect(f) { // Returns the exception, or `null`.
+ try {
+ f();
+ return null;
+ } catch (e) {
+ return e;
+ };
+ }
+
+ test(name, function(done) { // 'function' to allow `this.timeout`.
async_helper.asyncTestInitialize(done);
console.debug('Running test: ' + name);
let mainLibrary = dart_library.import(module)[name];
let negative = /negative_test/.test(name);
- if (has('fail')) negative = !negative;
- if (negative) {
- assert.throws(mainLibrary.main);
+ if (has('slow')) this.timeout(5000);
+ if (has('fail')) {
+ let e = protect(mainLibrary.main);
+ if (negative) {
+ if (e != null) {
+ throw new Error(
+ "negative test marked as 'fail' " +
+ "but passed by throwing:\n" + e);
+ }
+ } else {
+ if (e == null) {
+ throw new Error("test marked as 'fail' but passed");
+ }
+ }
} else {
- mainLibrary.main();
+ if (negative) {
+ assert.throws(mainLibrary.main);
+ } else {
+ mainLibrary.main();
+ }
}
if (!async_helper.asyncTestStarted) done();
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | test/codegen/corelib/int_parse_radix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698