From c642b183e78d916974b591da13139dcf9176dca2 Mon Sep 17 00:00:00 2001 From: jberg Date: Fri, 12 Jul 2019 14:49:57 -0700 Subject: [PATCH] More basic tests (#805) * add more basic tests * add/update passing test strings * only coerce if int is on LHS --- .../src/maki-interpreter/interpreter.test.js | 38 +++-- .../basicTests.m | 150 +++++++++++++++--- .../basicTests.maki | Bin 6161 -> 8698 bytes .../v1.1.1.b3 (Winamp 3.0 full)/basicTests.m | 150 +++++++++++++++--- .../basicTests.maki | Bin 6241 -> 8778 bytes .../v1.1.13 (Winamp 5.02)/basicTests.m | 150 +++++++++++++++--- .../v1.1.13 (Winamp 5.02)/basicTests.maki | Bin 6932 -> 9605 bytes .../v1.2.0 (Winamp 5.66)/basicTests.m | 150 +++++++++++++++--- .../v1.2.0 (Winamp 5.66)/basicTests.maki | Bin 7127 -> 9698 bytes .../src/maki-interpreter/virtualMachine.js | 6 - 10 files changed, 539 insertions(+), 105 deletions(-) diff --git a/experiments/modern/src/maki-interpreter/interpreter.test.js b/experiments/modern/src/maki-interpreter/interpreter.test.js index 5c4f64ed..f758f8d4 100644 --- a/experiments/modern/src/maki-interpreter/interpreter.test.js +++ b/experiments/modern/src/maki-interpreter/interpreter.test.js @@ -79,11 +79,18 @@ describe("can use basic operators", () => { [ "2 + 2 = 4", "2.2 + 2.2 = 4.4", + "4 + 4.4 = 4.4 + 4 (not implict casting)", + "#t + #t = 2", "3 - 2 = 1", "3 - -2 = 5", "3.5 - 2 = 1.5", "2 * 3 = 6", "2 * 1.5 = 3", + "#t * 3 = 3", + "#f * 3 = 0", + "#t * 0.25 = 0.25", + "0.25 * #t = 0.25", + "#f * 0.25 = 0", "6 / 3 = 2", "3 / 2 = 1.5", "5 % 2 = 1", @@ -98,27 +105,36 @@ describe("can use basic operators", () => { "1 < 2", "2 > 1", "[int] 4 = [float] 4.4 (autocasting types)", + "! [float] 4.4 = [int] 4 (not autocasting types)", + "[float] 4.4 != [int] 4 (not autocasting types)", + "! [int] 4 != [float] 4.4 (autocasting types)", "[int] 4 <= [float] 4.4 (autocasting types)", "[int] 4 >= [float] 4.4 (autocasting types)", + "! [float] 4.4 <= [int] 4 (not autocasting types)", + "[float] 4.4 >= [int] 4 (not autocasting types)", "! [int] 4 < [float] 4.4 (autocasting types)", + "! [float] 4.4 < [int] 4 (not autocasting types)", "! [int] 4 > [float] 4.4 (autocasting types)", + "[float] 4.4 > [int] 4 (not autocasting types)", "1++ = 1", "1++ (after incremeent) = 2", "2-- = 2", "2-- (after decrement) = 1", "++1 = 2", - "!f", + "!#f", "!0", - "!1 == 0", - "1 == 1", - "0 == 0", - "1 && 1", - "!(1 && 0)", - "!(0 && 0)", - "1 || 1", - "1 || 0", - "0 || 1", - "!(0 || 0)", + "!1 == #f", + "1 == #t", + "0 == #f", + "#t && #t", + "!(#t && #f)", + "!(#f && #f)", + "#t || #t", + "#t || #f", + "#f || #t", + "!(#f || #f)", + "#t || ++n (doesn't short circuit)", + "!(#f && ++ n) (doesn\'t short circuit)" ].map(successOutputFromMessage) ); }); diff --git a/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/basicTests.m b/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/basicTests.m index ab08372f..18f14911 100755 --- a/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/basicTests.m +++ b/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/basicTests.m @@ -16,6 +16,18 @@ System.onScriptLoaded() messageBox("2.2 + 2.2 = 4.4", "Fail", 1, ""); } + if (sum + sumFloat == sumFloat + sum) { + messageBox("4 + 4.4 = 4.4 + 4 (not implict casting)", "Success", 0, ""); + } else { + messageBox("4 + 4.4 = 4.4 + 4 (not implict casting)", "Fail", 1, ""); + } + + if (true + true == 2) { + messageBox("#t + #t = 2", "Success", 0, ""); + } else { + messageBox("#t + #t = 2", "Fail", 1, ""); + } + if (3 - 2 == 1) { messageBox("3 - 2 = 1", "Success", 0, ""); } else { @@ -46,6 +58,36 @@ System.onScriptLoaded() messageBox("2 * 1.5 = 3", "Fail", 1, ""); } + if (true * 3 == 3) { + messageBox("#t * 3 = 3", "Success", 0, ""); + } else { + messageBox("#t * 3 = 3", "Fail", 1, ""); + } + + if (false * 3 == 0) { + messageBox("#f * 3 = 0", "Success", 0, ""); + } else { + messageBox("#f * 3 = 0", "Fail", 1, ""); + } + + if (true * 0.25 == 0.25) { + messageBox("#t * 0.25 = 0.25", "Success", 0, ""); + } else { + messageBox("#t * 0.25 = 0.25", "Fail", 1, ""); + } + + if (0.25 * true == 0.25) { + messageBox("0.25 * #t = 0.25", "Success", 0, ""); + } else { + messageBox("0.25 * #t = 0.25", "Fail", 1, ""); + } + + if (false * 0.25 == 0) { + messageBox("#f * 0.25 = 0", "Success", 0, ""); + } else { + messageBox("#f * 0.25 = 0", "Fail", 1, ""); + } + if (6 / 3 == 2) { messageBox("6 / 3 = 2", "Success", 0, ""); } else { @@ -132,6 +174,24 @@ System.onScriptLoaded() messageBox("[int] 4 = [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (!(sumFloat == sum)) { + messageBox("! [float] 4.4 = [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("! [float] 4.4 = [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (sumFloat != sum) { + messageBox("[float] 4.4 != [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("[float] 4.4 != [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (!(sum != sumFloat)) { + messageBox("! [int] 4 != [float] 4.4 (autocasting types)", "Success", 0, ""); + } else { + messageBox("! [int] 4 != [float] 4.4 (autocasting types)", "Fail", 1, ""); + } + if (sum <= sumFloat) { messageBox("[int] 4 <= [float] 4.4 (autocasting types)", "Success", 0, ""); } else { @@ -144,18 +204,43 @@ System.onScriptLoaded() messageBox("[int] 4 >= [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (!(sumFloat <= sum)) { + messageBox("! [float] 4.4 <= [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("! [float] 4.4 <= [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (sumFloat >= sum) { + messageBox("[float] 4.4 >= [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("[float] 4.4 >= [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (!(sum < sumFloat)) { messageBox("! [int] 4 < [float] 4.4 (autocasting types)", "Success", 0, ""); } else { messageBox("! [int] 4 < [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (!(sumFloat < sum)) { + messageBox("! [float] 4.4 < [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("! [float] 4.4 < [int] 4 (not autocasting types)", "Fail", 1, ""); + } + if (!(sum > sumFloat)) { messageBox("! [int] 4 > [float] 4.4 (autocasting types)", "Success", 0, ""); } else { messageBox("! [int] 4 > [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (sumFloat > sum) { + messageBox("[float] 4.4 > [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("[float] 4.4 > [int] 4 (not autocasting types)", "Fail", 1, ""); + } + Int tempOne = 1; if (tempOne++ == one) { messageBox("1++ = 1", "Success", 0, ""); @@ -204,9 +289,9 @@ System.onScriptLoaded() Boolean f = false; if (!f) { - messageBox("!f", "Success", 0, ""); + messageBox("!#f", "Success", 0, ""); } else { - messageBox("!f", "Fail", 1, ""); + messageBox("!#f", "Fail", 1, ""); } if (!0) { @@ -216,62 +301,83 @@ System.onScriptLoaded() } if (!1 == false) { - messageBox("!1 == false", "Success", 0, ""); + messageBox("!1 == #f", "Success", 0, ""); } else { - messageBox("!1 == false", "Fail", 1, ""); + messageBox("!1 == #f", "Fail", 1, ""); } if (1 == true) { - messageBox("1 == true", "Success", 0, ""); + messageBox("1 == #t", "Success", 0, ""); } else { - messageBox("1 == true", "Fail", 1, ""); + messageBox("1 == #t", "Fail", 1, ""); } if (0 == false) { - messageBox("0 == false", "Success", 0, ""); + messageBox("0 == #f", "Success", 0, ""); } else { - messageBox("0 == false", "Fail", 1, ""); + messageBox("0 == #f", "Fail", 1, ""); } if (true && true) { - messageBox("true && true", "Success", 0, ""); + messageBox("#t && #t", "Success", 0, ""); } else { - messageBox("true && true", "Fail", 1, ""); + messageBox("#t && #t", "Fail", 1, ""); } if (!(true && false)) { - messageBox("!(true && false)", "Success", 0, ""); + messageBox("!(#t && #f)", "Success", 0, ""); } else { - messageBox("!(true && false)", "Fail", 1, ""); + messageBox("!(#t && #f)", "Fail", 1, ""); } if (!(false && false)) { - messageBox("!(false && false)", "Success", 0, ""); + messageBox("!(#f && #f)", "Success", 0, ""); } else { - messageBox("!(false && false)", "Fail", 1, ""); + messageBox("!(#f && #f)", "Fail", 1, ""); } if (true || true) { - messageBox("true || true", "Success", 0, ""); + messageBox("#t || #t", "Success", 0, ""); } else { - messageBox("true || true", "Fail", 1, ""); + messageBox("#t || #t", "Fail", 1, ""); } if (true || false) { - messageBox("true || false", "Success", 0, ""); + messageBox("#t || #f", "Success", 0, ""); } else { - messageBox("true || false", "Fail", 1, ""); + messageBox("#t || #f", "Fail", 1, ""); } if (false || true) { - messageBox("false || true", "Success", 0, ""); + messageBox("#f || #t", "Success", 0, ""); } else { - messageBox("false || true", "Fail", 1, ""); + messageBox("#f || #t", "Fail", 1, ""); } if (!(false || false)) { - messageBox("!(false || false)", "Success", 0, ""); + messageBox("!(#f || #f)", "Success", 0, ""); } else { - messageBox("!(false || false)", "Fail", 1, ""); + messageBox("!(#f || #f)", "Fail", 1, ""); + } + + Int n = 1; + if (true || ++n) { + if (n == 2) { + messageBox("#t || ++n (doesn't short circuit)", "Success", 0, ""); + } else { + messageBox("#t || ++n (did short circuit)", "Fail", 1, ""); + } + } else { + messageBox("#t || ++n", "Fail", 1, ""); + } + + if (!(false && ++n)) { + if (n == 3) { + messageBox("!(#f && ++ n) (doesn't short circuit)", "Success", 0, ""); + } else { + messageBox("!(#f && ++ n) (did short circuit)", "Fail", 1, ""); + } + } else { + messageBox("!(#f && ++ n)", "Fail", 1, ""); } } diff --git a/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/basicTests.maki b/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 build 488d)/basicTests.maki index abdcedf725d7cc6dcb2ab80aae4e077529dd92a2..7f7c3369ec4190bf0b4cbe38949a3f86dd28c92e 100755 GIT binary patch literal 8698 zcmdU!dr(x@9mnqliM&?OHbz6myCDJ#va-7@Dg|6#3M_&vR)Q2GgOz*BCWB%-#NSdSa8p| z)9D}0&UiV$b3VWC`JKl-kL&UkvD5BS6vYVtw$!*?-!iyrpLu`(QLFvh<&KnpygSx^ ztfv3U3D3tzO7}i|#_$)z2|UR_!7 zUFXP==JxK`YiHes8s1yk~CN^OxSQFFgB^b6|Aa$rpEK5B=%ck*a|9 zOj-X|hwr~}<*u9co1WhANTa!WXxjNbZBMQZoIY9PxX1sl^QrHrzG>=TuwrHD;elUW zKiJUwaN^aRs+z~fhCk@I-uv5{q0Q6bodF1}0i?%z*j<4JP zLQ~Zb-gGzZKihL?^mpI(rtki!Vc)D9l{XS@Rb`EKd_8lWvu;=OhX<1XSyOcD?TbJD ztoOY0xwJsag^`q7mv;S8Z63NXbKs>9e(!f}P5jBHf8X(P+Wzvverw@ia$jxhwsWIb zdmGDl$F;o?$SxjBD=_cd+d1ZV>WSnu-=FuyZP|CB@Mi3%wFA$_#Tb$ts{_=^Vuf?5P`J?plm z4f<6?B(Gt}@xQErYihUEevy`_4WG|4{q56FM)m~FV(it(vj1P}ziqAl z7L`G7VBaJtRxMYvY9(3$I!{*`yW87gRg4D%OL1je-sbI`0jU(lYGyP%fj1YVKxURw z00Lm}EKFJ=V%t7N;F#EX^I0y-$l;-}G~^nT4D=1NM#xG~3bjS7dh0!4CPBc9c>HF21}nE~3wXu? zFy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1*{Fua%+%*7QtY9WS+3e@nsi7aMf*bJ;?nu31DZ!j`VVwfg-2qbHDND{-({?oxn zAc>!YWKj}BQLc*qPS@#>B!)|3l&b^-grBBlVG=_v7ire(&?JVM?uy>@1|5>bP}2pH zt8_>b!&{CAaDk*tha@r7nJ&Qqt=6GQjM@k|Yd*Z`7%j^va;4%II$nr}TEV}d>%!C|4AWh=}(Ld**m@JUyaR&eYUNQa$**WuD delta 1209 zcmYk4J7`l;7{~8P+oX9kY2ImG_oR8WNt%1^BS~A$qe-J!(80m6f(R~-f`b%_II2kb zKvWO}7bj^^1i_($qp!uqK?>5vNf*Tj)bD&Zt+~TF|KI<6obO!D@6|1Rd*EOLIN|sR z&9Nu&VJ!0OT$Q^m;4;JK-#g!gqf@E+0WcHgr${lcjwYlNsO0IzDsUNh zceDbpLxRo1PNWQ1!*$q=7U6wZ%$DR79$a(>o0D4J95wmUaKqV95@oZ=I?BU| zq+Vhry3ga7a8hiJ@JCFjqp6lG8xAk^GPCm@#)ZpfyUn+_m>SL1;ZC{$gM>(rc3YI) zT)5z`kQ#bw3ce-;oXV)snGtX|Q-m$tZ>ny19!|kN>UOpO%Sqe2pH0DS)L*hi*u#BM mEwV0My9?J<4OUVDKC1-)+znn}eTwzr8W(Vo5)<-O<^BOdiPtOu diff --git a/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 full)/basicTests.m b/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 full)/basicTests.m index ab08372f..18f14911 100755 --- a/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 full)/basicTests.m +++ b/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 full)/basicTests.m @@ -16,6 +16,18 @@ System.onScriptLoaded() messageBox("2.2 + 2.2 = 4.4", "Fail", 1, ""); } + if (sum + sumFloat == sumFloat + sum) { + messageBox("4 + 4.4 = 4.4 + 4 (not implict casting)", "Success", 0, ""); + } else { + messageBox("4 + 4.4 = 4.4 + 4 (not implict casting)", "Fail", 1, ""); + } + + if (true + true == 2) { + messageBox("#t + #t = 2", "Success", 0, ""); + } else { + messageBox("#t + #t = 2", "Fail", 1, ""); + } + if (3 - 2 == 1) { messageBox("3 - 2 = 1", "Success", 0, ""); } else { @@ -46,6 +58,36 @@ System.onScriptLoaded() messageBox("2 * 1.5 = 3", "Fail", 1, ""); } + if (true * 3 == 3) { + messageBox("#t * 3 = 3", "Success", 0, ""); + } else { + messageBox("#t * 3 = 3", "Fail", 1, ""); + } + + if (false * 3 == 0) { + messageBox("#f * 3 = 0", "Success", 0, ""); + } else { + messageBox("#f * 3 = 0", "Fail", 1, ""); + } + + if (true * 0.25 == 0.25) { + messageBox("#t * 0.25 = 0.25", "Success", 0, ""); + } else { + messageBox("#t * 0.25 = 0.25", "Fail", 1, ""); + } + + if (0.25 * true == 0.25) { + messageBox("0.25 * #t = 0.25", "Success", 0, ""); + } else { + messageBox("0.25 * #t = 0.25", "Fail", 1, ""); + } + + if (false * 0.25 == 0) { + messageBox("#f * 0.25 = 0", "Success", 0, ""); + } else { + messageBox("#f * 0.25 = 0", "Fail", 1, ""); + } + if (6 / 3 == 2) { messageBox("6 / 3 = 2", "Success", 0, ""); } else { @@ -132,6 +174,24 @@ System.onScriptLoaded() messageBox("[int] 4 = [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (!(sumFloat == sum)) { + messageBox("! [float] 4.4 = [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("! [float] 4.4 = [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (sumFloat != sum) { + messageBox("[float] 4.4 != [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("[float] 4.4 != [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (!(sum != sumFloat)) { + messageBox("! [int] 4 != [float] 4.4 (autocasting types)", "Success", 0, ""); + } else { + messageBox("! [int] 4 != [float] 4.4 (autocasting types)", "Fail", 1, ""); + } + if (sum <= sumFloat) { messageBox("[int] 4 <= [float] 4.4 (autocasting types)", "Success", 0, ""); } else { @@ -144,18 +204,43 @@ System.onScriptLoaded() messageBox("[int] 4 >= [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (!(sumFloat <= sum)) { + messageBox("! [float] 4.4 <= [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("! [float] 4.4 <= [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (sumFloat >= sum) { + messageBox("[float] 4.4 >= [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("[float] 4.4 >= [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (!(sum < sumFloat)) { messageBox("! [int] 4 < [float] 4.4 (autocasting types)", "Success", 0, ""); } else { messageBox("! [int] 4 < [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (!(sumFloat < sum)) { + messageBox("! [float] 4.4 < [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("! [float] 4.4 < [int] 4 (not autocasting types)", "Fail", 1, ""); + } + if (!(sum > sumFloat)) { messageBox("! [int] 4 > [float] 4.4 (autocasting types)", "Success", 0, ""); } else { messageBox("! [int] 4 > [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (sumFloat > sum) { + messageBox("[float] 4.4 > [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("[float] 4.4 > [int] 4 (not autocasting types)", "Fail", 1, ""); + } + Int tempOne = 1; if (tempOne++ == one) { messageBox("1++ = 1", "Success", 0, ""); @@ -204,9 +289,9 @@ System.onScriptLoaded() Boolean f = false; if (!f) { - messageBox("!f", "Success", 0, ""); + messageBox("!#f", "Success", 0, ""); } else { - messageBox("!f", "Fail", 1, ""); + messageBox("!#f", "Fail", 1, ""); } if (!0) { @@ -216,62 +301,83 @@ System.onScriptLoaded() } if (!1 == false) { - messageBox("!1 == false", "Success", 0, ""); + messageBox("!1 == #f", "Success", 0, ""); } else { - messageBox("!1 == false", "Fail", 1, ""); + messageBox("!1 == #f", "Fail", 1, ""); } if (1 == true) { - messageBox("1 == true", "Success", 0, ""); + messageBox("1 == #t", "Success", 0, ""); } else { - messageBox("1 == true", "Fail", 1, ""); + messageBox("1 == #t", "Fail", 1, ""); } if (0 == false) { - messageBox("0 == false", "Success", 0, ""); + messageBox("0 == #f", "Success", 0, ""); } else { - messageBox("0 == false", "Fail", 1, ""); + messageBox("0 == #f", "Fail", 1, ""); } if (true && true) { - messageBox("true && true", "Success", 0, ""); + messageBox("#t && #t", "Success", 0, ""); } else { - messageBox("true && true", "Fail", 1, ""); + messageBox("#t && #t", "Fail", 1, ""); } if (!(true && false)) { - messageBox("!(true && false)", "Success", 0, ""); + messageBox("!(#t && #f)", "Success", 0, ""); } else { - messageBox("!(true && false)", "Fail", 1, ""); + messageBox("!(#t && #f)", "Fail", 1, ""); } if (!(false && false)) { - messageBox("!(false && false)", "Success", 0, ""); + messageBox("!(#f && #f)", "Success", 0, ""); } else { - messageBox("!(false && false)", "Fail", 1, ""); + messageBox("!(#f && #f)", "Fail", 1, ""); } if (true || true) { - messageBox("true || true", "Success", 0, ""); + messageBox("#t || #t", "Success", 0, ""); } else { - messageBox("true || true", "Fail", 1, ""); + messageBox("#t || #t", "Fail", 1, ""); } if (true || false) { - messageBox("true || false", "Success", 0, ""); + messageBox("#t || #f", "Success", 0, ""); } else { - messageBox("true || false", "Fail", 1, ""); + messageBox("#t || #f", "Fail", 1, ""); } if (false || true) { - messageBox("false || true", "Success", 0, ""); + messageBox("#f || #t", "Success", 0, ""); } else { - messageBox("false || true", "Fail", 1, ""); + messageBox("#f || #t", "Fail", 1, ""); } if (!(false || false)) { - messageBox("!(false || false)", "Success", 0, ""); + messageBox("!(#f || #f)", "Success", 0, ""); } else { - messageBox("!(false || false)", "Fail", 1, ""); + messageBox("!(#f || #f)", "Fail", 1, ""); + } + + Int n = 1; + if (true || ++n) { + if (n == 2) { + messageBox("#t || ++n (doesn't short circuit)", "Success", 0, ""); + } else { + messageBox("#t || ++n (did short circuit)", "Fail", 1, ""); + } + } else { + messageBox("#t || ++n", "Fail", 1, ""); + } + + if (!(false && ++n)) { + if (n == 3) { + messageBox("!(#f && ++ n) (doesn't short circuit)", "Success", 0, ""); + } else { + messageBox("!(#f && ++ n) (did short circuit)", "Fail", 1, ""); + } + } else { + messageBox("!(#f && ++ n)", "Fail", 1, ""); } } diff --git a/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 full)/basicTests.maki b/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 full)/basicTests.maki index 8155ba9472df3f0cb7fdcb367c9e545e45c890e0..a08b95b833dcd2cc3ce3f513db9c236cf859ad2d 100755 GIT binary patch literal 8778 zcmdU!e^6A{702HLiSkR(Mx&wPBUE5PR(63^2|t!!@?!yAu@a;hDD0Y@A}B1z7)&5d zOlBfARt;F4N;{3e+FF{%7{#DztuB}G zquCiB_uTtA-*fJL_uY5zb5T*?g!>dliGzP@OC0uR!|kP8-`{)KoPOnd0w8K)jAZpRRyo2q(%WBIA@5{CWgZsM!!sch3$lR0v z^p#D|)w~sLd9^02_R_}LwtW%Z)2p}7%-wnE{R+$Jk8M3e>yPi=l+gc|9fO6f+Sc4{ zUmJM%=9T+yRjhuY?uklcasPyK+v}fO-g@$QhV_A#cWuxAAo7f1+nl2E?1MdTU*EsD z>+z7QiG?NK93J?f@p{*LCH*J&*BF0s{8rA&SHHe;ez&#zZ|k~Bk48N@*t7UI{g2M9 z*tz_-y{T_D#fNJ@-~V@eqV3p|wYJl>Wos84i|+nzadz?1y6)NezdRLWeRER8!k@(2 zIC@2EIoed^G|85dKh4If>x@jF$8 zKRn~8+Iza=z|bGQ<%-_&@#0-mZx-APzEc=K)cB3K6}Ga?)gSH)`&UWEowqK&a=YuC z?Zv3pi1ULHcP?%Ivs&GMeoD`t5B}ITMdfKL1QuRP#sMgVydkZ@CrtS!vIXpnxM6;x4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(!(sumFloat <= sum)) { + messageBox("! [float] 4.4 <= [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("! [float] 4.4 <= [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (sumFloat >= sum) { + messageBox("[float] 4.4 >= [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("[float] 4.4 >= [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (!(sum < sumFloat)) { messageBox("! [int] 4 < [float] 4.4 (autocasting types)", "Success", 0, ""); } else { messageBox("! [int] 4 < [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (!(sumFloat < sum)) { + messageBox("! [float] 4.4 < [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("! [float] 4.4 < [int] 4 (not autocasting types)", "Fail", 1, ""); + } + if (!(sum > sumFloat)) { messageBox("! [int] 4 > [float] 4.4 (autocasting types)", "Success", 0, ""); } else { messageBox("! [int] 4 > [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (sumFloat > sum) { + messageBox("[float] 4.4 > [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("[float] 4.4 > [int] 4 (not autocasting types)", "Fail", 1, ""); + } + Int tempOne = 1; if (tempOne++ == one) { messageBox("1++ = 1", "Success", 0, ""); @@ -204,9 +289,9 @@ System.onScriptLoaded() Boolean f = false; if (!f) { - messageBox("!f", "Success", 0, ""); + messageBox("!#f", "Success", 0, ""); } else { - messageBox("!f", "Fail", 1, ""); + messageBox("!#f", "Fail", 1, ""); } if (!0) { @@ -216,62 +301,83 @@ System.onScriptLoaded() } if (!1 == false) { - messageBox("!1 == false", "Success", 0, ""); + messageBox("!1 == #f", "Success", 0, ""); } else { - messageBox("!1 == false", "Fail", 1, ""); + messageBox("!1 == #f", "Fail", 1, ""); } if (1 == true) { - messageBox("1 == true", "Success", 0, ""); + messageBox("1 == #t", "Success", 0, ""); } else { - messageBox("1 == true", "Fail", 1, ""); + messageBox("1 == #t", "Fail", 1, ""); } if (0 == false) { - messageBox("0 == false", "Success", 0, ""); + messageBox("0 == #f", "Success", 0, ""); } else { - messageBox("0 == false", "Fail", 1, ""); + messageBox("0 == #f", "Fail", 1, ""); } if (true && true) { - messageBox("true && true", "Success", 0, ""); + messageBox("#t && #t", "Success", 0, ""); } else { - messageBox("true && true", "Fail", 1, ""); + messageBox("#t && #t", "Fail", 1, ""); } if (!(true && false)) { - messageBox("!(true && false)", "Success", 0, ""); + messageBox("!(#t && #f)", "Success", 0, ""); } else { - messageBox("!(true && false)", "Fail", 1, ""); + messageBox("!(#t && #f)", "Fail", 1, ""); } if (!(false && false)) { - messageBox("!(false && false)", "Success", 0, ""); + messageBox("!(#f && #f)", "Success", 0, ""); } else { - messageBox("!(false && false)", "Fail", 1, ""); + messageBox("!(#f && #f)", "Fail", 1, ""); } if (true || true) { - messageBox("true || true", "Success", 0, ""); + messageBox("#t || #t", "Success", 0, ""); } else { - messageBox("true || true", "Fail", 1, ""); + messageBox("#t || #t", "Fail", 1, ""); } if (true || false) { - messageBox("true || false", "Success", 0, ""); + messageBox("#t || #f", "Success", 0, ""); } else { - messageBox("true || false", "Fail", 1, ""); + messageBox("#t || #f", "Fail", 1, ""); } if (false || true) { - messageBox("false || true", "Success", 0, ""); + messageBox("#f || #t", "Success", 0, ""); } else { - messageBox("false || true", "Fail", 1, ""); + messageBox("#f || #t", "Fail", 1, ""); } if (!(false || false)) { - messageBox("!(false || false)", "Success", 0, ""); + messageBox("!(#f || #f)", "Success", 0, ""); } else { - messageBox("!(false || false)", "Fail", 1, ""); + messageBox("!(#f || #f)", "Fail", 1, ""); + } + + Int n = 1; + if (true || ++n) { + if (n == 2) { + messageBox("#t || ++n (doesn't short circuit)", "Success", 0, ""); + } else { + messageBox("#t || ++n (did short circuit)", "Fail", 1, ""); + } + } else { + messageBox("#t || ++n", "Fail", 1, ""); + } + + if (!(false && ++n)) { + if (n == 3) { + messageBox("!(#f && ++ n) (doesn't short circuit)", "Success", 0, ""); + } else { + messageBox("!(#f && ++ n) (did short circuit)", "Fail", 1, ""); + } + } else { + messageBox("!(#f && ++ n)", "Fail", 1, ""); } } diff --git a/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.13 (Winamp 5.02)/basicTests.maki b/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.1.13 (Winamp 5.02)/basicTests.maki index 6ee8793ca3f2fd398cb1f798bfc1b8aa8cba7cbc..02905f688e2d2c22ec64099d9101e9736ce8dc16 100755 GIT binary patch delta 2525 zcmah}OK)366u#pmPW(!oxQU-l#&PqwaqQUFc5YIfH0c9q(zNL#ZAqH8A&J3K>y+eH zs8S`v0wI9}i&F^+)D41ts|vvu2{yojAHael!3ro6E0Ca^bH;XWT8UV?$LIUz`_7!1 zduQ&9zcqjFTZg#%;5&yd;82r(uKMpUFc(nAxC5m72{Qj*rO57qHId$;z+n@ z4yDNTD_pAK%mKuHHJ(WuWTC$SW|4MIJf*epp5`Jy%KQzi@P7X3@q-yXs!(1AnTQg*_D6`m4evENmPERv7varyW5IK0Q zEs+?0>LHY6p6aK# zXYrY58k*kIGmD<2t)U|Kv+RnEAI6cV_XJ1(e@~9U>#oe~QM9IZ?acIE#^=$}s%4W& ze5KhJ;4@cW^*B>TDut9WhajvG7+xz`o7-|@bA5aB`ewz_$uZB`WRkuJV*x>v7EhE; zV&c%^nN#@Rrp0k^N+wE+tX04|%^;&j&ae(o!{DGyRIRfJJz9LYMwIk(b)v+IlD&>uOYXe7wT+iRxw^f6vux=r zsN26wSKer7l;jdhTu&sc2nVQb?h<#jqCZ<*IWKb)PfOJV8SX;quAt7hyQDyhehz$Y z;PX|_gZu7P0e1r~?~Ld|MtCvIz^pGSy5V8_5XEo+z7IAx%?J;ywfDk=*AzkM@apiP z*YpL+M93GVi!Ma-HEWL_J4CcDn-wvxa>-Y0CGTO;%ec4Q^imlSV={>3 z5<_%dMj=c!3rPR1b$l+%u3&O8w=c<7CY zaVi<6d(<{@L*pe4JltoxxdicUri$GreF^YKS5!<=iOA&c5{(a}ZH^81x=nY3h z!!;Z(rLYu)`9Ku!N-T--{eS^K^_ZT9)2Fl(L0dHsPjDxwIuiS0@F-|Hl?DC{^ub(6 z4XxtPry-kDtwn^*z%lH;zFU+}h&+E7UxZC3j};gOB4(dm`XbqC8%z15P`Ym-W~;(n zMqt=)LoD!aEr2JO5+^x732VWe zIK??eK9zl9k?|sgLWVfaIYxD2;hj)aoM8@QI0!$7V&W|0voI3QiF2G|tm*HDqhg6U zjA28Z=lnbrBZj!Z`33kOk`osxH|Tb>t^6fgM(x|AKS9L7)BdaVT%9Yi%!O7c4$&oO ZE5S#bZHsd@pE@V2?7PhI3j7&~{|5sy6rlhB delta 1325 zcmZ8g%TE(Q7~d%`TZ*(mS=w#4v)vYHYs>Cz%lK%EJO%Zt2OsejOpFng^xy%5nrJ*} z;^)nqClh1T5RDhZAD}l+96f71>CK4Wd|RPPvOB-meBU?Q;oi|F6R$r8*pc;5fjom~ z=W}?~F|eNQ8e*`~UBKr%b0D(o;o7jKX+h27B`$cKyCXequCUPyh zO4J)g8qx%>)wqj2Dtm}mc%wmFKpq;wB+&sf8yarCM)$jeIHI&9GkPJJl3U|ZKL5Y5k<`#=Mgu4$(g2>qUOULu)DauM>%R(eQD_%Di|4&T?3I=qM*@I{w! zD;b2iVK70SAg^f{Fg>EY99~zor$TxomBfpSJX6J*ZD*ZOQ?({kcpuwKKVT#-yU8mN zy%Lw{_UL}KO?_QFjKcewpUWgest&{y3|$as6jx~drRE7l)#6CN27 zj`K8p#q|Zx!F*D}2P+5>%YbKyFIZXlOYAXu3syhYs1= [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (!(sumFloat <= sum)) { + messageBox("! [float] 4.4 <= [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("! [float] 4.4 <= [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (sumFloat >= sum) { + messageBox("[float] 4.4 >= [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("[float] 4.4 >= [int] 4 (not autocasting types)", "Fail", 1, ""); + } + + if (!(sum < sumFloat)) { messageBox("! [int] 4 < [float] 4.4 (autocasting types)", "Success", 0, ""); } else { messageBox("! [int] 4 < [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (!(sumFloat < sum)) { + messageBox("! [float] 4.4 < [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("! [float] 4.4 < [int] 4 (not autocasting types)", "Fail", 1, ""); + } + if (!(sum > sumFloat)) { messageBox("! [int] 4 > [float] 4.4 (autocasting types)", "Success", 0, ""); } else { messageBox("! [int] 4 > [float] 4.4 (autocasting types)", "Fail", 1, ""); } + if (sumFloat > sum) { + messageBox("[float] 4.4 > [int] 4 (not autocasting types)", "Success", 0, ""); + } else { + messageBox("[float] 4.4 > [int] 4 (not autocasting types)", "Fail", 1, ""); + } + Int tempOne = 1; if (tempOne++ == one) { messageBox("1++ = 1", "Success", 0, ""); @@ -204,9 +289,9 @@ System.onScriptLoaded() Boolean f = false; if (!f) { - messageBox("!f", "Success", 0, ""); + messageBox("!#f", "Success", 0, ""); } else { - messageBox("!f", "Fail", 1, ""); + messageBox("!#f", "Fail", 1, ""); } if (!0) { @@ -216,62 +301,83 @@ System.onScriptLoaded() } if (!1 == false) { - messageBox("!1 == false", "Success", 0, ""); + messageBox("!1 == #f", "Success", 0, ""); } else { - messageBox("!1 == false", "Fail", 1, ""); + messageBox("!1 == #f", "Fail", 1, ""); } if (1 == true) { - messageBox("1 == true", "Success", 0, ""); + messageBox("1 == #t", "Success", 0, ""); } else { - messageBox("1 == true", "Fail", 1, ""); + messageBox("1 == #t", "Fail", 1, ""); } if (0 == false) { - messageBox("0 == false", "Success", 0, ""); + messageBox("0 == #f", "Success", 0, ""); } else { - messageBox("0 == false", "Fail", 1, ""); + messageBox("0 == #f", "Fail", 1, ""); } if (true && true) { - messageBox("true && true", "Success", 0, ""); + messageBox("#t && #t", "Success", 0, ""); } else { - messageBox("true && true", "Fail", 1, ""); + messageBox("#t && #t", "Fail", 1, ""); } if (!(true && false)) { - messageBox("!(true && false)", "Success", 0, ""); + messageBox("!(#t && #f)", "Success", 0, ""); } else { - messageBox("!(true && false)", "Fail", 1, ""); + messageBox("!(#t && #f)", "Fail", 1, ""); } if (!(false && false)) { - messageBox("!(false && false)", "Success", 0, ""); + messageBox("!(#f && #f)", "Success", 0, ""); } else { - messageBox("!(false && false)", "Fail", 1, ""); + messageBox("!(#f && #f)", "Fail", 1, ""); } if (true || true) { - messageBox("true || true", "Success", 0, ""); + messageBox("#t || #t", "Success", 0, ""); } else { - messageBox("true || true", "Fail", 1, ""); + messageBox("#t || #t", "Fail", 1, ""); } if (true || false) { - messageBox("true || false", "Success", 0, ""); + messageBox("#t || #f", "Success", 0, ""); } else { - messageBox("true || false", "Fail", 1, ""); + messageBox("#t || #f", "Fail", 1, ""); } if (false || true) { - messageBox("false || true", "Success", 0, ""); + messageBox("#f || #t", "Success", 0, ""); } else { - messageBox("false || true", "Fail", 1, ""); + messageBox("#f || #t", "Fail", 1, ""); } if (!(false || false)) { - messageBox("!(false || false)", "Success", 0, ""); + messageBox("!(#f || #f)", "Success", 0, ""); } else { - messageBox("!(false || false)", "Fail", 1, ""); + messageBox("!(#f || #f)", "Fail", 1, ""); + } + + Int n = 1; + if (true || ++n) { + if (n == 2) { + messageBox("#t || ++n (doesn't short circuit)", "Success", 0, ""); + } else { + messageBox("#t || ++n (did short circuit)", "Fail", 1, ""); + } + } else { + messageBox("#t || ++n", "Fail", 1, ""); + } + + if (!(false && ++n)) { + if (n == 3) { + messageBox("!(#f && ++ n) (doesn't short circuit)", "Success", 0, ""); + } else { + messageBox("!(#f && ++ n) (did short circuit)", "Fail", 1, ""); + } + } else { + messageBox("!(#f && ++ n)", "Fail", 1, ""); } } diff --git a/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.2.0 (Winamp 5.66)/basicTests.maki b/experiments/modern/src/maki-interpreter/reference/maki_compiler/v1.2.0 (Winamp 5.66)/basicTests.maki index 9f9a679f64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iments/modern/src/maki-interpreter/virtualMachine.js index 8fa51627..f2dbfebf 100644 --- a/experiments/modern/src/maki-interpreter/virtualMachine.js +++ b/experiments/modern/src/maki-interpreter/virtualMachine.js @@ -1,12 +1,6 @@ const Variable = require("./variable"); function coerceTypes (var1, var2, val1, val2) { - if (var1.type === 'INT') { - if (var2.type === 'FLOAT' || var2.type === 'DOUBLE') { - return [val1, Math.floor(val2)]; - } - } - if (var2.type === 'INT') { if (var1.type === 'FLOAT' || var1.type === 'DOUBLE') { return [Math.floor(val1), val2];