| Index: tests/language/regex/UC16_test.dart
|
| diff --git a/tests/language/regex/UC16_test.dart b/tests/language/regex/UC16_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a7f8d5f7a9406f8c1b343d0b4bb2f34bd0d251bb
|
| --- /dev/null
|
| +++ b/tests/language/regex/UC16_test.dart
|
| @@ -0,0 +1,29 @@
|
| +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +import 'util.dart';
|
| +import 'package:expect/expect.dart';
|
| +
|
| +void main() {
|
| + // UC16
|
| + // Characters used:
|
| + // "\u03a3\u03c2\u03c3\u039b\u03bb" - Sigma, final sigma, sigma, Lambda, lamda
|
| + shouldBe(new RegExp(r"x(.)\1x", caseSensitive: false).firstMatch("x\u03a3\u03c3x"),
|
| + ["x\u03a3\u03c3x", "\u03a3"], "backref-UC16");
|
| + assertFalse(new RegExp(r"x(...)\1", caseSensitive: false).hasMatch("x\u03a3\u03c2\u03c3\u03c2\u03c3"),
|
| + "\1 ASCII, string short");
|
| + assertTrue(new RegExp(r"\u03a3((?:))\1\1x", caseSensitive: false).hasMatch("\u03c2x"), "backref-UC16-empty");
|
| + assertTrue(new RegExp(r"x(?:...|(...))\1x", caseSensitive: false).hasMatch("x\u03a3\u03c2\u03c3x"),
|
| + "backref-UC16-uncaptured");
|
| + assertTrue(new RegExp(r"x(?:...|(...))\1x", caseSensitive: false).hasMatch("x\u03c2\u03c3\u039b\u03a3\u03c2\u03bbx"),
|
| + "backref-UC16-backtrack");
|
| + var longUC16String = "x\u03a3\u03c2\u039b\u03c2\u03c3\u03bb\u03c3\u03a3\u03bb";
|
| + shouldBe(new RegExp(r"x(...)\1\1", caseSensitive: false).firstMatch(longUC16String),
|
| + [longUC16String, longUC16String.substring(1,4)],
|
| + "backref-UC16-twice");
|
| +
|
| + assertFalse(new RegExp(r"\xc1", caseSensitive: false).hasMatch('fooA'), "quickcheck-uc16-pattern-ascii-subject");
|
| + assertFalse(new RegExp(r"[\xe9]").hasMatch('i'), "charclass-uc16-pattern-ascii-subject");
|
| + assertFalse(new RegExp(r"\u5e74|\u6708").hasMatch('t'), "alternation-uc16-pattern-ascii-subject");
|
| +}
|
|
|