Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
35b2ca94
Commit
35b2ca94
authored
Nov 30, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 01, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added lastIndex tests.
parent
d0062198
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
regexp.js
dlls/jscript/tests/regexp.js
+66
-0
No files found.
dlls/jscript/tests/regexp.js
View file @
35b2ca94
...
...
@@ -298,4 +298,70 @@ ok(re === RegExp(re, undefined), "re !== RegExp(re, undefined)");
re
=
/abc/
;
ok
(
re
===
RegExp
(
re
,
undefined
,
1
),
"re !== RegExp(re, undefined, 1)"
);
re
=
/a/g
;
ok
(
re
.
lastIndex
===
0
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 0"
);
m
=
re
.
exec
(
" a "
);
ok
(
re
.
lastIndex
===
2
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 2"
);
ok
(
m
.
index
===
1
,
"m.index = "
+
m
.
index
+
" expected 1"
);
m
=
re
.
exec
(
" a "
);
ok
(
re
.
lastIndex
===
0
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 0"
);
ok
(
m
===
null
,
"m = "
+
m
+
" expected null"
);
re
.
lastIndex
=
2
;
m
=
re
.
exec
(
" a a "
);
ok
(
re
.
lastIndex
===
4
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 4"
);
ok
(
m
.
index
===
3
,
"m.index = "
+
m
.
index
+
" expected 3"
);
re
.
lastIndex
=
"2"
;
ok
(
re
.
lastIndex
===
"2"
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected '2'"
);
m
=
re
.
exec
(
" a a "
);
ok
(
re
.
lastIndex
===
4
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 4"
);
ok
(
m
.
index
===
3
,
"m.index = "
+
m
.
index
+
" expected 3"
);
var
li
=
0
;
var
obj
=
new
Object
();
obj
.
valueOf
=
function
()
{
return
li
;
};
re
.
lastIndex
=
obj
;
ok
(
re
.
lastIndex
===
obj
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected obj"
);
li
=
2
;
m
=
re
.
exec
(
" a a "
);
ok
(
re
.
lastIndex
===
2
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 2"
);
ok
(
m
.
index
===
1
,
"m.index = "
+
m
.
index
+
" expected 1"
);
re
.
lastIndex
=
3
;
re
.
lastIndex
=
"test"
;
ok
(
re
.
lastIndex
===
"test"
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 'test'"
);
m
=
re
.
exec
(
" a a "
);
ok
(
re
.
lastIndex
===
2
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 2"
);
ok
(
m
.
index
===
1
,
"m.index = "
+
m
.
index
+
" expected 1"
);
re
.
lastIndex
=
0
;
re
.
lastIndex
=
3.9
;
ok
(
re
.
lastIndex
===
3.9
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 3.9"
);
m
=
re
.
exec
(
" a a "
);
ok
(
re
.
lastIndex
===
4
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 4"
);
ok
(
m
.
index
===
3
,
"m.index = "
+
m
.
index
+
" expected 3"
);
obj
.
valueOf
=
function
()
{
throw
0
;
}
re
.
lastIndex
=
obj
;
ok
(
re
.
lastIndex
===
obj
,
"unexpected re.lastIndex"
);
m
=
re
.
exec
(
" a a "
);
ok
(
re
.
lastIndex
===
2
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 2"
);
ok
(
m
.
index
===
1
,
"m.index = "
+
m
.
index
+
" expected 1"
);
re
.
lastIndex
=
-
3
;
ok
(
re
.
lastIndex
===
-
3
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected -3"
);
m
=
re
.
exec
(
" a a "
);
ok
(
re
.
lastIndex
===
0
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 0"
);
ok
(
m
===
null
,
"m = "
+
m
+
" expected null"
);
re
.
lastIndex
=
-
1
;
ok
(
re
.
lastIndex
===
-
1
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected -1"
);
m
=
re
.
exec
(
" "
);
ok
(
re
.
lastIndex
===
0
,
"re.lastIndex = "
+
re
.
lastIndex
+
" expected 0"
);
ok
(
m
===
null
,
"m = "
+
m
+
" expected null"
);
reportSuccess
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment