diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/non262/RegExp/RegExp_dollar_number.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/non262/RegExp/RegExp_dollar_number.js | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/js/src/tests/non262/RegExp/RegExp_dollar_number.js b/js/src/tests/non262/RegExp/RegExp_dollar_number.js new file mode 100644 index 0000000000..52680a1870 --- /dev/null +++ b/js/src/tests/non262/RegExp/RegExp_dollar_number.js @@ -0,0 +1,76 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + Filename: RegExp_dollar_number.js + Description: 'Tests RegExps $1, ..., $9 properties' + + Author: Nick Lerissa + Date: March 12, 1998 +*/ + +var SECTION = 'As described in Netscape doc "What\'s new in JavaScript 1.2"'; +var TITLE = 'RegExp: $1, ..., $9'; +var BUGNUMBER="123802"; + +printBugNumber(BUGNUMBER); +writeHeaderToLog('Executing script: RegExp_dollar_number.js'); +writeHeaderToLog( SECTION + " "+ TITLE); + + +// 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$1 +'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); +new TestCase ( "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$1", + 'abcdefghi', RegExp.$1); + +// 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$2 +new TestCase ( "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$2", + 'bcdefgh', RegExp.$2); + +// 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$3 +new TestCase ( "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$3", + 'cdefg', RegExp.$3); + +// 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$4 +new TestCase ( "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$4", + 'def', RegExp.$4); + +// 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$5 +new TestCase ( "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$5", + 'e', RegExp.$5); + +// 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$6 +new TestCase ( "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$6", + '', RegExp.$6); + +var a_to_z = 'abcdefghijklmnopqrstuvwxyz'; +var regexp1 = /(a)b(c)d(e)f(g)h(i)j(k)l(m)n(o)p(q)r(s)t(u)v(w)x(y)z/ + // 'abcdefghijklmnopqrstuvwxyz'.match(/(a)b(c)d(e)f(g)h(i)j(k)l(m)n(o)p(q)r(s)t(u)v(w)x(y)z/); RegExp.$1 + a_to_z.match(regexp1); + +new TestCase ( "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$1", + 'a', RegExp.$1); +new TestCase ( "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$2", + 'c', RegExp.$2); +new TestCase ( "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$3", + 'e', RegExp.$3); +new TestCase ( "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$4", + 'g', RegExp.$4); +new TestCase ( "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$5", + 'i', RegExp.$5); +new TestCase ( "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$6", + 'k', RegExp.$6); +new TestCase ( "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$7", + 'm', RegExp.$7); +new TestCase ( "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$8", + 'o', RegExp.$8); +new TestCase ( "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$9", + 'q', RegExp.$9); +/* + new TestCase ( "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$10", + 's', RegExp.$10); +*/ +test(); |