Pas2JS pascal source code
var
s : Variant = 'mummy';
i : Variant = 10;
vs := 'dummy';
vi : Integer;
BEGIN
case vs of
s : WriteLn('bug');
Variant('dummy') : WriteLn('ok');
else
WriteLn('bug');
end;
vi := 12;
case vi of
i : WriteLn('bug');
(i+1)..12 : WriteLn('ok');
else
WriteLn('bug');
end;
{ ### CONSOLE OUTPUTS ###
ok
ok
}
{ <<< TEST II >>> }
s := 'dummy';
i := 12;
case s of
'mummy' : WriteLn('bug');
'dummy' : WriteLn('ok');
else
WriteLn('bug');
end;
case i of
10 : WriteLn('bug');
11..12 : WriteLn('ok');
else
WriteLn('bug');
end;
{ ### CONSOLE OUTPUTS ###
ok
ok
}
var s,
s = "mummy";
var i,
i = 10;
var vs = "dummy";
var vi = 0;
{var $temp1 = vs;
if ($temp1==s) {
WriteLn("bug") }
else if ($temp1=="dummy") {
WriteLn("ok") }
else {
WriteLn("bug") }
}
vi = 12;
{var $temp2 = vi;
if ($temp2==i) {
WriteLn("bug") }
else if (($temp2>=(i+1))&&($temp2<=12)) {
WriteLn("ok") }
else {
WriteLn("bug") }
}
s = "dummy";
i = 12;
{var $temp3 = s;
if ($temp3=="mummy") {
WriteLn("bug") }
else if ($temp3=="dummy") {
WriteLn("ok") }
else {
WriteLn("bug") }
}
{var $temp4 = i;
if ($temp4==10) {
WriteLn("bug") }
else if (($temp4>=11)&&($temp4<=12)) {
WriteLn("ok") }
else {
WriteLn("bug") }
}