Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
test262
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pmaksimo
test262
Commits
01490455
Commit
01490455
authored
10 years ago
by
Brian Terlson
Browse files
Options
Downloads
Plain Diff
Merge pull request #86 from smikes/pr/83
browser runner: check negative regex
parents
0caf4eec
4debe087
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
test/harness/ed.js
+14
-3
14 additions, 3 deletions
test/harness/ed.js
test/harness/gs.js
+50
-52
50 additions, 52 deletions
test/harness/gs.js
test/harness/sth.js
+1
-1
1 addition, 1 deletion
test/harness/sth.js
test/suite/ch08/8.7/S8.7.1_A2.js
+3
-2
3 additions, 2 deletions
test/suite/ch08/8.7/S8.7.1_A2.js
with
68 additions
and
58 deletions
test/harness/ed.js
+
14
−
3
View file @
01490455
...
...
@@ -6,9 +6,20 @@
//Error Detector
if
(
this
.
window
!==
undefined
)
{
//for console support
this
.
window
.
onerror
=
function
(
errorMsg
,
url
,
lineNumber
)
{
this
.
window
.
iframeError
=
errorMsg
;
if
(
typeof
$DONE
===
'
function
'
)
$DONE
();
this
.
window
.
onerror
=
function
(
errorMsg
,
url
,
lineNumber
,
colNumber
,
error
)
{
var
cookedError
;
if
(
error
)
{
cookedError
=
error
.
toString
();
}
else
{
if
(
/Error:/
.
test
(
errorMsg
))
{
cookedError
=
errorMsg
;
}
else
{
cookedError
=
"
UnknownError:
"
+
errorMsg
;
}
}
$DONE
(
cookedError
);
};
}
This diff is collapsed.
Click to expand it.
test/harness/gs.js
+
50
−
52
View file @
01490455
...
...
@@ -5,68 +5,66 @@
/// copyright and this notice and otherwise comply with the Use Terms.
//Global Scope Test Case Validator
function
$DONE
()
{
var
doneCalled
;
function
$DONE
(
argError
)
{
var
testError
;
var
result
,
resultError
;
if
(
argError
)
{
testError
=
argError
.
toString
();
}
if
(
doneCalled
)
{
// ? log called twice
return
;
}
doneCalled
=
true
;
//An exception is expected
if
(
testDescrip
.
negative
!==
undefined
)
{
//TODO - come up with a generic way of catching the error type
//from this.onerror
testDescrip
.
negative
=
testDescrip
.
negative
===
"
NotEarlyError
"
?
testDescrip
.
negative
:
(
testDescrip
.
negative
===
"
^((?!NotEarlyError).)*$
"
?
testDescrip
.
negative
:
"
.
"
);
if
(
this
.
iframeError
===
undefined
)
{
//no exception was thrown
testRun
(
testDescrip
.
id
,
testDescrip
.
path
,
testDescrip
.
description
,
testDescrip
.
code
,
'
fail
'
,
Error
(
'
No exception was thrown; expected an error "message"
'
+
'
property matching the regular expression "
'
+
testDescrip
.
negative
+
'
".
'
));
}
else
if
(
!
(
new
RegExp
(
testDescrip
.
negative
,
"
i
"
).
test
(
this
.
iframeError
)))
{
var
negRegexp
=
new
RegExp
(
testDescrip
.
negative
,
"
i
"
),
unkRegexp
=
/^UnknownError:/
;
if
(
!
testError
)
{
//no exception was thrown
result
=
'
fail
'
;
resultError
=
Error
(
'
No exception was thrown; expected an error "message"
'
+
'
property matching the regular expression "
'
+
testDescrip
.
negative
+
'
".
'
);
}
else
if
(
!
negRegexp
.
test
(
testError
)
&&
!
unkRegexp
.
test
(
testError
))
{
//wrong type of exception thrown
testRun
(
testDescrip
.
id
,
testDescrip
.
path
,
testDescrip
.
description
,
testDescrip
.
code
,
'
fail
'
,
Error
(
'
Expected an exception with a "message"
'
+
'
property matching the regular expression "
'
+
testDescrip
.
negative
+
'
" to be thrown; actual was "
'
+
this
.
iframeError
+
'
".
'
));
result
=
'
fail
'
;
resultError
=
Error
(
'
Expected an exception with a "message"
'
+
'
property matching the regular expression "
'
+
testDescrip
.
negative
+
'
" to be thrown; actual was "
'
+
testError
+
'
".
'
);
}
else
{
testRun
(
testDescrip
.
id
,
testDescrip
.
path
,
testDescrip
.
description
,
testDescrip
.
code
,
'
pass
'
,
undefined
);
result
=
'
pass
'
;
resultError
=
'
undefined
'
;
}
}
else
if
(
testError
)
{
//Exception was not expected to be thrown
result
=
'
fail
'
;
resultError
=
Error
(
'
Unexpected exception, "
'
+
testError
+
'
" was thrown.
'
);
}
else
{
result
=
'
pass
'
;
resultError
=
undefined
;
}
//Exception was not expected to be thrown
else
if
(
this
.
iframeError
!==
undefined
)
{
testRun
(
testDescrip
.
id
,
testDescrip
.
path
,
testDescrip
.
description
,
testDescrip
.
code
,
'
fail
'
,
Error
(
'
Unexpected exception, "
'
+
this
.
iframeError
+
'
" was thrown.
'
));
}
else
{
testRun
(
testDescrip
.
id
,
testDescrip
.
path
,
testDescrip
.
description
,
testDescrip
.
code
,
'
pass
'
,
undefined
);
}
testRun
(
testDescrip
.
id
,
testDescrip
.
path
,
testDescrip
.
description
,
testDescrip
.
code
,
result
,
resultError
);
//teardown
testFinished
();
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
test/harness/sth.js
+
1
−
1
View file @
01490455
...
...
@@ -129,7 +129,7 @@ function BrowserRunner() {
//TODO - 500ms *should* be a sufficient delay
setTimeout
(
function
()
{
instance
.
supportsWindowOnerror
=
iwinPrereqs
.
failCount
===
2
;
instance
.
supportsWindowOnerror
=
(
iwinPrereqs
.
failCount
===
2
)
;
//alert(iwinPrereqs.failCount);
document
.
body
.
removeChild
(
iframePrereqs
);
instance
.
run
(
test
,
code
);
...
...
This diff is collapsed.
Click to expand it.
test/suite/ch08/8.7/S8.7.1_A2.js
+
3
−
2
View file @
01490455
...
...
@@ -14,8 +14,9 @@ var y = 1;
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if
(
delete
y
){
$ERROR
(
'
#1: y = 1; (delete y) === false. Actual:
'
+
((
delete
y
)));
var
result
=
delete
y
;
if
(
result
){
$ERROR
(
'
#1: y = 1; (delete y) === false. Actual:
'
+
result
);
};
//
//////////////////////////////////////////////////////////////////////////////
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment