Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
68c61d17
Commit
68c61d17
authored
Oct 01, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added tests for @if/@elif/@else/@end.
parent
afba44d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
104 additions
and
0 deletions
+104
-0
cc.js
dlls/jscript/tests/cc.js
+104
-0
No files found.
dlls/jscript/tests/cc.js
View file @
68c61d17
...
...
@@ -140,9 +140,107 @@ ok(@test === false, "@test = " + @test);
@
set
@
test
=
(
0
!=
true
)
ok
(@
test
===
true
,
"@test = "
+
@
test
);
@
if
(
false
)
this
wouldn
not
parse
"@end
@if (false) "
@
end
tmp
=
"@if (false) @end"
;
ok
(
tmp
.
length
===
16
,
"tmp.length = "
+
tmp
.
length
);
@
if
(
true
)
tmp
=
true
@
end
ok
(
tmp
===
true
,
"tmp = "
+
tmp
);
@
if
(
false
)
@
if
this
would
not
CC
parse
this
will
not
parse
@
elif
(
true
)
this
will
also
not
parse
@
else
this
also
will
not
parse
@
if
let
me
complicate
things
a
bit
@
end
enough
@
end
@
end
@
if
(
false
)
this
will
not
parse
@
else
tmp
=
2
@
else
this
will
not
be
parsed
@
else
also
this
@
end
ok
(
tmp
===
2
,
"tmp = "
+
tmp
);
@
if
(
true
)
tmp
=
3
;
@
else
just
skip
this
@
end
ok
(
tmp
===
3
,
"tmp = "
+
tmp
);
@
if
(
true
)
tmp
=
4
;
@
elif
(
true
)
this
will
not
parse
@
elif
nor
this
@
else
just
skip
this
@
end
ok
(
tmp
===
4
,
"tmp = "
+
tmp
);
@
if
(
false
)
this
will
not
parse
@
elif
(
false
)
nor
this
would
@
elif
(
true
)
tmp
=
5
;
@
elif
nor
this
@
else
just
skip
this
@
end
ok
(
tmp
===
5
,
"tmp = "
+
tmp
);
@
if
(
!
@
_jscript
)
this
would
not
parse
@
if
(
true
)
@
else
@
if
(
false
)
@
end
@
end
@
elif
(@
_jscript
)
tmp
=
6
;
@
elif
(
true
)
@
if
xxx
@
else
@
if
@
elif
@
elif
@
else
@
end
@
end
@
else
this
would
not
parse
@
end
ok
(
tmp
===
6
,
"tmp = "
+
tmp
);
@
if
(
true
)
@
if
(
false
)
@
else
tmp
=
7
;
@
end
@
else
this
would
not
parse
@
end
ok
(
tmp
===
7
,
"tmp = "
+
tmp
);
var
exception_map
=
{
JS_E_SYNTAX
:
{
type
:
"SyntaxError"
,
number
:
-
2146827286
},
JS_E_MISSING_LBRACKET
:
{
type
:
"SyntaxError"
,
number
:
-
2146827283
},
JS_E_EXPECTED_IDENTIFIER
:
{
type
:
"SyntaxError"
,
number
:
-
2146827278
},
JS_E_EXPECTED_ASSIGN
:
{
type
:
"SyntaxError"
,
number
:
-
2146827277
},
JS_E_EXPECTED_CCEND
:
{
type
:
"SyntaxError"
,
number
:
-
2146827259
},
JS_E_EXPECTED_AT
:
{
type
:
"SyntaxError"
,
number
:
-
2146827256
}
};
...
...
@@ -164,5 +262,11 @@ function testException(src, id) {
testException
(
"@set test=true"
,
"JS_E_EXPECTED_AT"
);
testException
(
"@set @1=true"
,
"JS_E_EXPECTED_IDENTIFIER"
);
testException
(
"@set @test x=true"
,
"JS_E_EXPECTED_ASSIGN"
);
testException
(
"@if false
\
n@end"
,
"JS_E_MISSING_LBRACKET"
);
testException
(
"@if (false)
\
n"
,
"JS_E_EXPECTED_CCEND"
);
testException
(
"@end
\
n"
,
"JS_E_SYNTAX"
);
testException
(
"@elif
\
n"
,
"JS_E_SYNTAX"
);
testException
(
"@else
\
n"
,
"JS_E_SYNTAX"
);
testException
(
"@if false
\
n@elif true
\
n@end"
,
"JS_E_MISSING_LBRACKET"
);
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