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

Unified Diff: tests/corelib_strong/regexp/no-extensions_test.dart

Issue 2989003002: Migrated test block 20 to Dart 2.0. (Closed)
Patch Set: Created 3 years, 5 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_strong/regexp/no-extensions_test.dart
diff --git a/tests/corelib_strong/regexp/no-extensions_test.dart b/tests/corelib_strong/regexp/no-extensions_test.dart
deleted file mode 100644
index 131d250627e2ff141f865896f2723c37066c728d..0000000000000000000000000000000000000000
--- a/tests/corelib_strong/regexp/no-extensions_test.dart
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. All rights reserved.
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import 'v8_regexp_utils.dart';
-import 'package:expect/expect.dart';
-
-void main() {
- description(
- 'Tests that regular expressions do not have extensions that diverge from the JavaScript specification. ' +
- 'Because WebKit originally used a copy of PCRE, various non-JavaScript regular expression features were historically present. ' +
- 'Also tests various related edge cases.');
-
- shouldBeNull(new RegExp(r"\\x{41}").firstMatch("yA1"));
- assertEquals(new RegExp(r"[\x{41}]").firstMatch("yA1").group(0), "1");
- assertEquals(new RegExp(r"\x1g").firstMatch("x1g").group(0), "x1g");
- assertEquals(new RegExp(r"[\x1g]").firstMatch("x").group(0), "x");
- assertEquals(new RegExp(r"[\x1g]").firstMatch("1").group(0), "1");
- assertEquals(
- new RegExp(r"\2147483648")
- .firstMatch(new String.fromCharCode(140) + "7483648")
- .group(0),
- new String.fromCharCode(140) + "7483648");
- assertEquals(new RegExp(r"\4294967296").firstMatch("\"94967296").group(0),
- "\"94967296");
- assertEquals(new RegExp(r"\8589934592").firstMatch("\8589934592").group(0),
- "\8589934592");
- assertEquals(
- "\nAbc\n".replaceAllMapped(new RegExp(r"(\n)[^\n]+$"), (m) => m.group(1)),
- "\nAbc\n");
- shouldBeNull(new RegExp(r"x$").firstMatch("x\n"));
- assertThrows(() => new RegExp(r"x++"));
- shouldBeNull(new RegExp(r"[]]").firstMatch("]"));
-
- assertEquals(new RegExp(r"\060").firstMatch("y01").group(0), "0");
- assertEquals(new RegExp(r"[\060]").firstMatch("y01").group(0), "0");
- assertEquals(new RegExp(r"\606").firstMatch("y06").group(0), "06");
- assertEquals(new RegExp(r"[\606]").firstMatch("y06").group(0), "0");
- assertEquals(new RegExp(r"[\606]").firstMatch("y6").group(0), "6");
- assertEquals(new RegExp(r"\101").firstMatch("yA1").group(0), "A");
- assertEquals(new RegExp(r"[\101]").firstMatch("yA1").group(0), "A");
- assertEquals(new RegExp(r"\1011").firstMatch("yA1").group(0), "A1");
- assertEquals(new RegExp(r"[\1011]").firstMatch("yA1").group(0), "A");
- assertEquals(new RegExp(r"[\1011]").firstMatch("y1").group(0), "1");
- assertEquals(
- new RegExp(r"\10q")
- .firstMatch("y" + new String.fromCharCode(8) + "q")
- .group(0),
- new String.fromCharCode(8) + "q");
- assertEquals(
- new RegExp(r"[\10q]")
- .firstMatch("y" + new String.fromCharCode(8) + "q")
- .group(0),
- new String.fromCharCode(8));
- assertEquals(
- new RegExp(r"\1q")
- .firstMatch("y" + new String.fromCharCode(1) + "q")
- .group(0),
- new String.fromCharCode(1) + "q");
- assertEquals(
- new RegExp(r"[\1q]")
- .firstMatch("y" + new String.fromCharCode(1) + "q")
- .group(0),
- new String.fromCharCode(1));
- assertEquals(new RegExp(r"[\1q]").firstMatch("yq").group(0), "q");
- assertEquals(new RegExp(r"\8q").firstMatch("\8q").group(0), "\8q");
- assertEquals(new RegExp(r"[\8q]").firstMatch("y8q").group(0), "8");
- assertEquals(new RegExp(r"[\8q]").firstMatch("yq").group(0), "q");
- shouldBe(new RegExp(r"(x)\1q").firstMatch("xxq"), ["xxq", "x"]);
- shouldBe(new RegExp(r"(x)[\1q]").firstMatch("xxq"), ["xq", "x"]);
- shouldBe(
- new RegExp(r"(x)[\1q]").firstMatch("xx" + new String.fromCharCode(1)),
- ["x" + new String.fromCharCode(1), "x"]);
-}
« no previous file with comments | « tests/corelib_strong/regexp/negative-special-characters_test.dart ('k') | tests/corelib_strong/regexp/non-bmp_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698