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

Unified Diff: tests/corelib/regexp/regress-regexp-construct-result_test.dart

Issue 667043003: Port regexp tests from V8 to Dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: dart authors copyright Created 6 years, 2 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
Index: tests/corelib/regexp/regress-regexp-construct-result_test.dart
diff --git a/runtime/third_party/double-conversion/src/strtod.h b/tests/corelib/regexp/regress-regexp-construct-result_test.dart
similarity index 65%
copy from runtime/third_party/double-conversion/src/strtod.h
copy to tests/corelib/regexp/regress-regexp-construct-result_test.dart
index ed0293b8f54a373762f17fe4dd70f2896eb1d193..ac9c032073bfc95f22bcc19a4424a7a2118130a2 100644
--- a/runtime/third_party/double-conversion/src/strtod.h
+++ b/tests/corelib/regexp/regress-regexp-construct-result_test.dart
@@ -1,4 +1,5 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright (c) 2014, the Dart project authors. All rights reserved.
+// Copyright 2013 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -25,21 +26,25 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef DOUBLE_CONVERSION_STRTOD_H_
-#define DOUBLE_CONVERSION_STRTOD_H_
+import 'v8_regexp_utils.dart';
+import 'package:expect/expect.dart';
-#include "utils.h"
+void main() {
+ // Create a huge regexp with many alternative capture groups, most of
+ // which do not capture anything, but the corresponding capture slot
+ // in the result object has to exist, even though filled with null.
+ // Having a large result array helps stressing GC.
-namespace double_conversion {
+ var num_captures = 1000;
+ var regexp_string = "(a)";
+ for (var i = 0; i < num_captures - 1; i++) {
+ regexp_string += "|(b)";
+ }
+ var regexp = new RegExp(regexp_string);
-// The buffer must only contain digits in the range [0-9]. It must not
-// contain a dot or a sign. It must not start with '0', and must not be empty.
-double Strtod(Vector<const char> buffer, int exponent);
-
-// The buffer must only contain digits in the range [0-9]. It must not
-// contain a dot or a sign. It must not start with '0', and must not be empty.
-float Strtof(Vector<const char> buffer, int exponent);
-
-} // namespace double_conversion
-
-#endif // DOUBLE_CONVERSION_STRTOD_H_
+ for (var i = 0; i < 10; i++) {
+ var matches = regexp.firstMatch("a");
+ var count = 0;
+ assertEquals(num_captures + 1, matches.groupCount + 1);
+ }
+}
« no previous file with comments | « tests/corelib/regexp/regress-regexp-codeflush_test.dart ('k') | tests/corelib/regexp/repeat-match-waldemar_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698