diff --git a/concept-code/moduleVariables.vsm b/concept-code/moduleVariables.vsm index 0610e63..e9a7cbe 100644 --- a/concept-code/moduleVariables.vsm +++ b/concept-code/moduleVariables.vsm @@ -1,4 +1,4 @@ -// test_output! [1, 2, 3, 12586269025] +//! test_output([1, 2, 3, 12586269025]) export @main {} diff --git a/inputs/failing/exceptions/snapshotThis.ts b/inputs/failing/exceptions/snapshotThis.ts index 01e6fcd..ef24858 100644 --- a/inputs/failing/exceptions/snapshotThis.ts +++ b/inputs/failing/exceptions/snapshotThis.ts @@ -1,4 +1,4 @@ -// test_output! 1 +//! test_output(1) // (Should be 0.) export default function main() { diff --git a/inputs/failing/numberMethods/toExponentialInconsistent.ts b/inputs/failing/numberMethods/toExponentialInconsistent.ts index ace15dc..c2c336e 100644 --- a/inputs/failing/numberMethods/toExponentialInconsistent.ts +++ b/inputs/failing/numberMethods/toExponentialInconsistent.ts @@ -1,4 +1,4 @@ -// test_output! [["1.20e+2","1.22e+2","1.22e+2","1.24e+2","1.24e+2"],["1.21e+0","1.22e+0","1.23e+0","1.24e+0","1.25e+0"]] +//! test_output([["1.20e+2","1.22e+2","1.22e+2","1.24e+2","1.24e+2"],["1.21e+0","1.22e+0","1.23e+0","1.24e+0","1.25e+0"]]) // This is wrong. There's some inconsistent banker's rounding going on. // It appears to be inherent to rust's {:.*e} formatting - a technical oversight? // Or maybe it has to do with parsing the source string into a number imprecisely? diff --git a/inputs/passing/anonymousMain.ts b/inputs/passing/anonymousMain.ts index 2f68310..648de58 100644 --- a/inputs/passing/anonymousMain.ts +++ b/inputs/passing/anonymousMain.ts @@ -1,4 +1,4 @@ -// test_output! "Done" +//! test_output("Done") export default function () { return "Done"; diff --git a/inputs/passing/arrayBuiltin.ts b/inputs/passing/arrayBuiltin.ts index 36b2695..6750cb2 100644 --- a/inputs/passing/arrayBuiltin.ts +++ b/inputs/passing/arrayBuiltin.ts @@ -1,4 +1,4 @@ -// test_output! [true,false,false,[1,2,3],["a","b","c"],[],[1,2,3],[],[,,],[3,1],[true]] +//! test_output([true,false,false,[1,2,3],["a","b","c"],[],[1,2,3],[],[,,],[3,1],[true]]) export default function () { return [ diff --git a/inputs/passing/assignmentEvalOrder.ts b/inputs/passing/assignmentEvalOrder.ts index 204edca..67c54fb 100644 --- a/inputs/passing/assignmentEvalOrder.ts +++ b/inputs/passing/assignmentEvalOrder.ts @@ -1,4 +1,4 @@ -// test_output! {"left":"right"} +//! test_output({"left":"right"}) export default function main() { let x = {} as any; diff --git a/inputs/passing/assignmentEvalOrder2.ts b/inputs/passing/assignmentEvalOrder2.ts index 811b770..572f2f4 100644 --- a/inputs/passing/assignmentEvalOrder2.ts +++ b/inputs/passing/assignmentEvalOrder2.ts @@ -1,4 +1,4 @@ -// test_output! ["a","b"] +//! test_output(["a","b"]) export default function main() { let log = []; diff --git a/inputs/passing/basicSymbol.ts b/inputs/passing/basicSymbol.ts index 80feff7..bdfee56 100644 --- a/inputs/passing/basicSymbol.ts +++ b/inputs/passing/basicSymbol.ts @@ -1,4 +1,4 @@ -// test_output! [Symbol.iterator,{},3] +//! test_output([Symbol.iterator,{},3]) export default function main() { const x = { [Symbol.iterator]: 3 }; diff --git a/inputs/passing/bigint/noMix.ts b/inputs/passing/bigint/noMix.ts index b76b5d8..8766764 100644 --- a/inputs/passing/bigint/noMix.ts +++ b/inputs/passing/bigint/noMix.ts @@ -1,4 +1,4 @@ -// test_output! E: TypeError{"message":"Cannot mix BigInt and other types"} +//! test_output(E: TypeError{"message":"Cannot mix BigInt and other types"}) export default function () { return 1 + (1n as unknown as number); diff --git a/inputs/passing/binaryTree.ts b/inputs/passing/binaryTree.ts index 8e50581..2bb767c 100644 --- a/inputs/passing/binaryTree.ts +++ b/inputs/passing/binaryTree.ts @@ -1,4 +1,4 @@ -// test_output! [[1,2,5],[1,2,3,4,5]] +//! test_output([[1,2,5],[1,2,3,4,5]]) export default function main() { let tree = BinaryTree(); diff --git a/inputs/passing/boolean.ts b/inputs/passing/boolean.ts index 7203304..9806139 100644 --- a/inputs/passing/boolean.ts +++ b/inputs/passing/boolean.ts @@ -1,4 +1,4 @@ -// test_output! [true,false,false,true,true,true,true,false,true,false,false,false] +//! test_output([true,false,false,true,true,true,true,false,true,false,false,false]) export default function () { return [ diff --git a/inputs/passing/capture.ts b/inputs/passing/capture.ts index 01b675c..5a60c83 100644 --- a/inputs/passing/capture.ts +++ b/inputs/passing/capture.ts @@ -1,4 +1,4 @@ -// test_output! [1,6,17] +//! test_output([1,6,17]) export default function () { const poly = buildPoly([1, 2, 3]); // 1 + 2*x + 3*x^2 diff --git a/inputs/passing/captureButNotRefBeforeInit.ts b/inputs/passing/captureButNotRefBeforeInit.ts index cbcc815..62ea1f4 100644 --- a/inputs/passing/captureButNotRefBeforeInit.ts +++ b/inputs/passing/captureButNotRefBeforeInit.ts @@ -1,4 +1,4 @@ -// test_output! 3 +//! test_output(3) export default function main() { function foo() { diff --git a/inputs/passing/captureShadowed.ts b/inputs/passing/captureShadowed.ts index 21dabcd..d90028d 100644 --- a/inputs/passing/captureShadowed.ts +++ b/inputs/passing/captureShadowed.ts @@ -1,4 +1,4 @@ -// test_output! 7 +//! test_output(7) export default function main() { function foo() { diff --git a/inputs/passing/complexPatternOrder.ts b/inputs/passing/complexPatternOrder.ts index 2f08265..d165411 100644 --- a/inputs/passing/complexPatternOrder.ts +++ b/inputs/passing/complexPatternOrder.ts @@ -1,4 +1,4 @@ -// test_output! ["c","a","b"] +//! test_output(["c","a","b"]) export default function main() { let log = []; diff --git a/inputs/passing/const/callNestedConstMethod.ts b/inputs/passing/const/callNestedConstMethod.ts index 3f9a369..a205772 100644 --- a/inputs/passing/const/callNestedConstMethod.ts +++ b/inputs/passing/const/callNestedConstMethod.ts @@ -1,4 +1,4 @@ -// test_output! 37 +//! test_output(37) export default function () { const foo = new Foo(); diff --git a/inputs/passing/const/violateWithArrayPush.ts b/inputs/passing/const/violateWithArrayPush.ts index 713f980..84f408e 100644 --- a/inputs/passing/const/violateWithArrayPush.ts +++ b/inputs/passing/const/violateWithArrayPush.ts @@ -1,4 +1,4 @@ -// test_output! E: TypeError{"message":"Cannot mutate this because it is const"} +//! test_output(E: TypeError{"message":"Cannot mutate this because it is const"}) export default function () { const arr = [1, 2]; diff --git a/inputs/passing/const/violateWithCustomMethod.ts b/inputs/passing/const/violateWithCustomMethod.ts index 3fe5c69..46d58be 100644 --- a/inputs/passing/const/violateWithCustomMethod.ts +++ b/inputs/passing/const/violateWithCustomMethod.ts @@ -1,4 +1,4 @@ -// test_output! E: TypeError{"message":"Cannot mutate this because it is const"} +//! test_output(E: TypeError{"message":"Cannot mutate this because it is const"}) export default function () { const foo = new Foo(); diff --git a/inputs/passing/const/violateWithCustomMethodNested.ts b/inputs/passing/const/violateWithCustomMethodNested.ts index 486c950..3dc1c7c 100644 --- a/inputs/passing/const/violateWithCustomMethodNested.ts +++ b/inputs/passing/const/violateWithCustomMethodNested.ts @@ -1,4 +1,4 @@ -// test_output! E: TypeError{"message":"Cannot mutate this because it is const"} +//! test_output(E: TypeError{"message":"Cannot mutate this because it is const"}) export default function () { const foo = new Foo(); diff --git a/inputs/passing/counter.ts b/inputs/passing/counter.ts index 0ca2e92..9bdc0a6 100644 --- a/inputs/passing/counter.ts +++ b/inputs/passing/counter.ts @@ -1,4 +1,4 @@ -// test_output! [1,2,3] +//! test_output([1,2,3]) export default function main() { let c = Counter(); diff --git a/inputs/passing/customIterator.ts b/inputs/passing/customIterator.ts index e91e2ec..6fb9d0b 100644 --- a/inputs/passing/customIterator.ts +++ b/inputs/passing/customIterator.ts @@ -1,4 +1,4 @@ -// test_output! [5,6,7,8,9] +//! test_output([5,6,7,8,9]) export default function () { let vals: number[] = []; diff --git a/inputs/passing/destructuring/decl/array.ts b/inputs/passing/destructuring/decl/array.ts index 50ed2e3..9e72981 100644 --- a/inputs/passing/destructuring/decl/array.ts +++ b/inputs/passing/destructuring/decl/array.ts @@ -1,4 +1,4 @@ -// test_output! 3 +//! test_output(3) export default function main() { const [a, b] = [1, 2]; diff --git a/inputs/passing/destructuring/decl/deeply_nested.ts b/inputs/passing/destructuring/decl/deeply_nested.ts index a01c98e..d6b6e80 100644 --- a/inputs/passing/destructuring/decl/deeply_nested.ts +++ b/inputs/passing/destructuring/decl/deeply_nested.ts @@ -1,4 +1,4 @@ -// test_ouput! 42 +//! test_output(42) export default function main() { const [[[{ x: { y: [[{ z }]] } }]]] = [[[{ x: { y: [[{ z: 42 }]] } }]]]; diff --git a/inputs/passing/destructuring/decl/multi_complex.ts b/inputs/passing/destructuring/decl/multi_complex.ts index 216c83e..9f57c7b 100644 --- a/inputs/passing/destructuring/decl/multi_complex.ts +++ b/inputs/passing/destructuring/decl/multi_complex.ts @@ -1,4 +1,4 @@ -// test_output! [55,145,237,43,31] +//! test_output([55,145,237,43,31]) export default function main() { let res = []; diff --git a/inputs/passing/destructuring/decl/object.ts b/inputs/passing/destructuring/decl/object.ts index 76d796c..f1b0d7d 100644 --- a/inputs/passing/destructuring/decl/object.ts +++ b/inputs/passing/destructuring/decl/object.ts @@ -1,4 +1,4 @@ -// test_output! 3 +//! test_output(3) export default function main() { const { a, b } = { a: 1, b: 2 }; diff --git a/inputs/passing/destructuring/param/array.ts b/inputs/passing/destructuring/param/array.ts index 102506f..89efdb4 100644 --- a/inputs/passing/destructuring/param/array.ts +++ b/inputs/passing/destructuring/param/array.ts @@ -1,4 +1,4 @@ -// test_output! 3 +//! test_output(3) export default function main() { return foo([1, 2]); diff --git a/inputs/passing/destructuring/param/deeply_nested.ts b/inputs/passing/destructuring/param/deeply_nested.ts index 34f9006..c219416 100644 --- a/inputs/passing/destructuring/param/deeply_nested.ts +++ b/inputs/passing/destructuring/param/deeply_nested.ts @@ -1,4 +1,4 @@ -// test_ouput! 42 +//! test_output(42) export default function main() { return foo([[[{ x: { y: [[{ z: 42 }]] } }]]]); diff --git a/inputs/passing/destructuring/param/multi_complex.ts b/inputs/passing/destructuring/param/multi_complex.ts index 08d21b0..2cca171 100644 --- a/inputs/passing/destructuring/param/multi_complex.ts +++ b/inputs/passing/destructuring/param/multi_complex.ts @@ -1,4 +1,4 @@ -// test_output! [55,145,237,43,31] +//! test_output([55,145,237,43,31]) export default function main() { return [ diff --git a/inputs/passing/destructuring/param/object.ts b/inputs/passing/destructuring/param/object.ts index e4624f0..a1782d8 100644 --- a/inputs/passing/destructuring/param/object.ts +++ b/inputs/passing/destructuring/param/object.ts @@ -1,4 +1,4 @@ -// test_output! 3 +//! test_output(3) export default function main() { return foo({ a: 1, b: 2 }); diff --git a/inputs/passing/dontRevertMath.ts b/inputs/passing/dontRevertMath.ts index 786f7c4..d4eda12 100644 --- a/inputs/passing/dontRevertMath.ts +++ b/inputs/passing/dontRevertMath.ts @@ -1,4 +1,4 @@ -// test_output! undefined +//! test_output(undefined) export default function () { try { diff --git a/inputs/passing/doublePreInc.ts b/inputs/passing/doublePreInc.ts index c8d66d0..3b47345 100644 --- a/inputs/passing/doublePreInc.ts +++ b/inputs/passing/doublePreInc.ts @@ -1,4 +1,4 @@ -// test_output! 3 +//! test_output(3) export default function main() { let x = 0; diff --git a/inputs/passing/exceptions/catchDestructure.ts b/inputs/passing/exceptions/catchDestructure.ts index ac4f09d..0aea903 100644 --- a/inputs/passing/exceptions/catchDestructure.ts +++ b/inputs/passing/exceptions/catchDestructure.ts @@ -1,4 +1,4 @@ -// test_output! 8 +//! test_output(8) export default function () { try { diff --git a/inputs/passing/exceptions/catchNonLocal.ts b/inputs/passing/exceptions/catchNonLocal.ts index bdaf3b9..127b888 100644 --- a/inputs/passing/exceptions/catchNonLocal.ts +++ b/inputs/passing/exceptions/catchNonLocal.ts @@ -1,4 +1,4 @@ -// test_output!: "Caught: boom" +//! test_output("Caught: boom") export default function () { try { diff --git a/inputs/passing/exceptions/finallyBreakSwallowsException.ts b/inputs/passing/exceptions/finallyBreakSwallowsException.ts index a4d3261..3356f13 100644 --- a/inputs/passing/exceptions/finallyBreakSwallowsException.ts +++ b/inputs/passing/exceptions/finallyBreakSwallowsException.ts @@ -1,4 +1,4 @@ -// test_output! "πŸ€·β€β™‚οΈ" +//! test_output("πŸ€·β€β™‚οΈ") export default function () { while (true) { diff --git a/inputs/passing/exceptions/finallyBreakSwallowsReturn.ts b/inputs/passing/exceptions/finallyBreakSwallowsReturn.ts index 0e0bd08..3d23dc4 100644 --- a/inputs/passing/exceptions/finallyBreakSwallowsReturn.ts +++ b/inputs/passing/exceptions/finallyBreakSwallowsReturn.ts @@ -1,4 +1,4 @@ -// test_output! "that thing" +//! test_output("that thing") export default function () { while (true) { diff --git a/inputs/passing/exceptions/finallyReturnSwallowsException.ts b/inputs/passing/exceptions/finallyReturnSwallowsException.ts index 26ccd6b..0e00d02 100644 --- a/inputs/passing/exceptions/finallyReturnSwallowsException.ts +++ b/inputs/passing/exceptions/finallyReturnSwallowsException.ts @@ -1,4 +1,4 @@ -// test_output! 42 +//! test_output(42) export default function () { try { diff --git a/inputs/passing/exceptions/finallyWithoutThrow.ts b/inputs/passing/exceptions/finallyWithoutThrow.ts index 467780c..f20ea30 100644 --- a/inputs/passing/exceptions/finallyWithoutThrow.ts +++ b/inputs/passing/exceptions/finallyWithoutThrow.ts @@ -1,4 +1,4 @@ -// test_output! "Ok" +//! test_output("Ok") export default function () { let result: string; diff --git a/inputs/passing/exceptions/isReturningReset.ts b/inputs/passing/exceptions/isReturningReset.ts index a3e4ccd..ca4452e 100644 --- a/inputs/passing/exceptions/isReturningReset.ts +++ b/inputs/passing/exceptions/isReturningReset.ts @@ -1,4 +1,4 @@ -// test_output! "that thing" +//! test_output("that thing") export default function () { while (true) { diff --git a/inputs/passing/exceptions/nestedFinally.ts b/inputs/passing/exceptions/nestedFinally.ts index 6f7810e..24b3ddb 100644 --- a/inputs/passing/exceptions/nestedFinally.ts +++ b/inputs/passing/exceptions/nestedFinally.ts @@ -1,4 +1,4 @@ -// test_error! ["outer finally",Error{"message":"inner finally"}] +//! test_error(["outer finally",Error{"message":"inner finally"}]) export default function () { let logs: unknown[] = []; diff --git a/inputs/passing/exceptions/nestedFinallyReturn.ts b/inputs/passing/exceptions/nestedFinallyReturn.ts index b710e50..903beb9 100644 --- a/inputs/passing/exceptions/nestedFinallyReturn.ts +++ b/inputs/passing/exceptions/nestedFinallyReturn.ts @@ -1,4 +1,4 @@ -// test_output! "this thing" +//! test_output("this thing") export default function () { while (true) { diff --git a/inputs/passing/exceptions/nestedRethrow.ts b/inputs/passing/exceptions/nestedRethrow.ts index 6c83caf..a2d4c57 100644 --- a/inputs/passing/exceptions/nestedRethrow.ts +++ b/inputs/passing/exceptions/nestedRethrow.ts @@ -1,4 +1,4 @@ -// test_error! Error{"message":"nested error"} +//! test_error(Error{"message":"nested error"}) export default function () { try { diff --git a/inputs/passing/exceptions/nestedTry.ts b/inputs/passing/exceptions/nestedTry.ts index a23b728..899169c 100644 --- a/inputs/passing/exceptions/nestedTry.ts +++ b/inputs/passing/exceptions/nestedTry.ts @@ -1,4 +1,4 @@ -// test_output! ["boom"] +//! test_output(["boom"]) // // Note: the original intention was for this to output ["here","nested boom","boom"] to check where // the control flow goes. This worked at the time, but now that snapshotting variables that can be diff --git a/inputs/passing/exceptions/revertMethodCallOnCatch.ts b/inputs/passing/exceptions/revertMethodCallOnCatch.ts index 8fbf422..8cfae66 100644 --- a/inputs/passing/exceptions/revertMethodCallOnCatch.ts +++ b/inputs/passing/exceptions/revertMethodCallOnCatch.ts @@ -1,4 +1,4 @@ -// test_output! [[],["item"]] +//! test_output([[],["item"]]) export default function () { return [ diff --git a/inputs/passing/exceptions/revertOnCatch.ts b/inputs/passing/exceptions/revertOnCatch.ts index bdf885e..9948c01 100644 --- a/inputs/passing/exceptions/revertOnCatch.ts +++ b/inputs/passing/exceptions/revertOnCatch.ts @@ -1,4 +1,4 @@ -// test_output! [0,1] +//! test_output([0,1]) export default function () { return [ diff --git a/inputs/passing/exceptions/revertSmallQueue.ts b/inputs/passing/exceptions/revertSmallQueue.ts index f2a22cd..5fe939d 100644 --- a/inputs/passing/exceptions/revertSmallQueue.ts +++ b/inputs/passing/exceptions/revertSmallQueue.ts @@ -1,4 +1,4 @@ -// test_output! [1,3,"SmallQueue is already full"] +//! test_output([1,3,"SmallQueue is already full"]) export default function () { let a = new SmallQueue(["item1"]); diff --git a/inputs/passing/exceptions/throwCustomError.ts b/inputs/passing/exceptions/throwCustomError.ts index 7eb280b..0800cb0 100644 --- a/inputs/passing/exceptions/throwCustomError.ts +++ b/inputs/passing/exceptions/throwCustomError.ts @@ -1,4 +1,4 @@ -// test_error! E: {"code":"400","message":"Bad request"} +//! test_error(E: {"code":"400","message":"Bad request"}) export default function () { throw new CustomError(400, "Bad request"); diff --git a/inputs/passing/exceptions/throwError.ts b/inputs/passing/exceptions/throwError.ts index d54ef40..c3a6188 100644 --- a/inputs/passing/exceptions/throwError.ts +++ b/inputs/passing/exceptions/throwError.ts @@ -1,4 +1,4 @@ -// test_error! Error{"message":"Test error"} +//! test_error(Error{"message":"Test error"}) export default function () { throw new Error("Test error"); diff --git a/inputs/passing/exceptions/throwTypeError.ts b/inputs/passing/exceptions/throwTypeError.ts index e5eb35a..5d84ebf 100644 --- a/inputs/passing/exceptions/throwTypeError.ts +++ b/inputs/passing/exceptions/throwTypeError.ts @@ -1,4 +1,4 @@ -// test_error! E: TypeError{"message":"Cannot subscript undefined"} +//! test_error(E: TypeError{"message":"Cannot subscript undefined"}) export default function () { const arr = undefined; diff --git a/inputs/passing/exceptions/tryCatch.ts b/inputs/passing/exceptions/tryCatch.ts index 8ded5b6..64a2fa9 100644 --- a/inputs/passing/exceptions/tryCatch.ts +++ b/inputs/passing/exceptions/tryCatch.ts @@ -1,4 +1,4 @@ -// test_output! Error{"message":"Something went wrong"} +//! test_output(Error{"message":"Something went wrong"}) export default function () { try { diff --git a/inputs/passing/exceptions/tryCatchFinally.ts b/inputs/passing/exceptions/tryCatchFinally.ts index 57f38fb..1561110 100644 --- a/inputs/passing/exceptions/tryCatchFinally.ts +++ b/inputs/passing/exceptions/tryCatchFinally.ts @@ -1,4 +1,4 @@ -// test_output! E: Error{"message":"teraboom"} +//! test_output(E: Error{"message":"teraboom"}) export default function () { try { diff --git a/inputs/passing/exceptions/tryCatchRethrow.ts b/inputs/passing/exceptions/tryCatchRethrow.ts index 30324fc..c312401 100644 --- a/inputs/passing/exceptions/tryCatchRethrow.ts +++ b/inputs/passing/exceptions/tryCatchRethrow.ts @@ -1,4 +1,4 @@ -// test_error! E: ["rethrow",Error{"message":"Something went wrong"}] +//! test_error(E: ["rethrow",Error{"message":"Something went wrong"}]) export default function () { try { diff --git a/inputs/passing/exceptions/tryFinally.ts b/inputs/passing/exceptions/tryFinally.ts index 904d14d..fcdc469 100644 --- a/inputs/passing/exceptions/tryFinally.ts +++ b/inputs/passing/exceptions/tryFinally.ts @@ -1,4 +1,4 @@ -// test_output! E: Error{"message":"Something went wrong"} +//! test_output(E: Error{"message":"Something went wrong"}) export default function () { try { diff --git a/inputs/passing/exceptions/tryReturnFinallyReturn.ts b/inputs/passing/exceptions/tryReturnFinallyReturn.ts index fe6ba65..47d0d2d 100644 --- a/inputs/passing/exceptions/tryReturnFinallyReturn.ts +++ b/inputs/passing/exceptions/tryReturnFinallyReturn.ts @@ -1,4 +1,4 @@ -// test_output! 42 +//! test_output(42) export default function () { try { diff --git a/inputs/passing/forOf.ts b/inputs/passing/forOf.ts index 0b19018..faf9620 100644 --- a/inputs/passing/forOf.ts +++ b/inputs/passing/forOf.ts @@ -1,4 +1,4 @@ -// test_output! [1,4,9] +//! test_output([1,4,9]) export default function () { let vals: number[] = []; diff --git a/inputs/passing/hello.ts b/inputs/passing/hello.ts index 2ea996c..d2d1c45 100644 --- a/inputs/passing/hello.ts +++ b/inputs/passing/hello.ts @@ -1,4 +1,4 @@ -// test_output! "Hello world!" +//! test_output("Hello world!") export default function main() { return 'Hello world!'; diff --git a/inputs/passing/importBar.ts b/inputs/passing/importBar.ts index 2abfcb2..202d0ab 100644 --- a/inputs/passing/importBar.ts +++ b/inputs/passing/importBar.ts @@ -1,4 +1,4 @@ -// test_output! ["this is the bar function","this is the bar function"] +//! test_output(["this is the bar function","this is the bar function"]) import { bar, barExported } from "./helpers/bar.ts"; diff --git a/inputs/passing/importFoo.ts b/inputs/passing/importFoo.ts index 234d4c1..47ebc97 100644 --- a/inputs/passing/importFoo.ts +++ b/inputs/passing/importFoo.ts @@ -1,4 +1,4 @@ -// test_output! "this is the foo function" +//! test_output("this is the foo function") import foo from "./helpers/foo.ts"; diff --git a/inputs/passing/importFooAndBar.ts b/inputs/passing/importFooAndBar.ts index bbee094..c899369 100644 --- a/inputs/passing/importFooAndBar.ts +++ b/inputs/passing/importFooAndBar.ts @@ -1,4 +1,4 @@ -// test_output! ["this is the foo function","this is the bar function"] +//! test_output(["this is the foo function","this is the bar function"]) import { bar, foo } from "./helpers/fooAndBar.ts"; diff --git a/inputs/passing/importFoobar.ts b/inputs/passing/importFoobar.ts index 8ec446a..822167c 100644 --- a/inputs/passing/importFoobar.ts +++ b/inputs/passing/importFoobar.ts @@ -1,4 +1,4 @@ -// test_output! ["this is the foo function","this is the bar function"] +//! test_output(["this is the foo function","this is the bar function"]) import foobar from "./helpers/foobar.ts"; diff --git a/inputs/passing/importType.ts b/inputs/passing/importType.ts index 7527d93..6103446 100644 --- a/inputs/passing/importType.ts +++ b/inputs/passing/importType.ts @@ -1,4 +1,4 @@ -// test_output! "done" +//! test_output("done") import { type Type } from "./helpers/Type.ts"; diff --git a/inputs/passing/iteration/manualArrayIteration.ts b/inputs/passing/iteration/manualArrayIteration.ts index e256fd8..5a5ca97 100644 --- a/inputs/passing/iteration/manualArrayIteration.ts +++ b/inputs/passing/iteration/manualArrayIteration.ts @@ -1,4 +1,4 @@ -// test_output! [[1,false],[2,false],[3,false],[undefined,true],[undefined,true]] +//! test_output([[1,false],[2,false],[3,false],[undefined,true],[undefined,true]]) export default function () { const vals = [1, 2, 3]; diff --git a/inputs/passing/mergeSort.ts b/inputs/passing/mergeSort.ts index 9377515..e3a284a 100644 --- a/inputs/passing/mergeSort.ts +++ b/inputs/passing/mergeSort.ts @@ -1,4 +1,4 @@ -// test_output! [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] +//! test_output([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]) export default function main() { const x = [7, 18, 9, 11, 16, 3, 8, 2, 5, 4, 6, 14, 15, 17, 10, 12, 1, 13]; diff --git a/inputs/passing/mergeSortStepper.ts b/inputs/passing/mergeSortStepper.ts index aaeff13..af6577d 100644 --- a/inputs/passing/mergeSortStepper.ts +++ b/inputs/passing/mergeSortStepper.ts @@ -1,4 +1,4 @@ -// test_output (TODO broken!) [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] +// test_output((TODO broken!) [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]) declare const Debug: { log: (...args: unknown[]) => undefined; diff --git a/inputs/passing/multiAssignment.ts b/inputs/passing/multiAssignment.ts index 4d4916d..910a22c 100644 --- a/inputs/passing/multiAssignment.ts +++ b/inputs/passing/multiAssignment.ts @@ -1,4 +1,4 @@ -// test_output! [1,1] +//! test_output([1,1]) export default function main() { let a; diff --git a/inputs/passing/multiCompoundAssignment.ts b/inputs/passing/multiCompoundAssignment.ts index 223d238..8c58c39 100644 --- a/inputs/passing/multiCompoundAssignment.ts +++ b/inputs/passing/multiCompoundAssignment.ts @@ -1,4 +1,4 @@ -// test_output! [17,15,12] +//! test_output([17,15,12]) export default function main() { let a = 2; diff --git a/inputs/passing/mutatedRegisterIssue.ts b/inputs/passing/mutatedRegisterIssue.ts index d7516c4..00357a8 100644 --- a/inputs/passing/mutatedRegisterIssue.ts +++ b/inputs/passing/mutatedRegisterIssue.ts @@ -1,4 +1,4 @@ -// test_output! [[1,2,3,4],[4,3,2,1]] +//! test_output([[1,2,3,4],[4,3,2,1]]) export default function main() { let x = [1, 2, 3, 4]; diff --git a/inputs/passing/nestedAssignment.ts b/inputs/passing/nestedAssignment.ts index 165e577..c366727 100644 --- a/inputs/passing/nestedAssignment.ts +++ b/inputs/passing/nestedAssignment.ts @@ -1,4 +1,4 @@ -// test_output! [1,4,9] +//! test_output([1,4,9]) export default function main() { let x = 0; diff --git a/inputs/passing/nestedCompoundAssignment.ts b/inputs/passing/nestedCompoundAssignment.ts index 38f2b66..846994d 100644 --- a/inputs/passing/nestedCompoundAssignment.ts +++ b/inputs/passing/nestedCompoundAssignment.ts @@ -1,4 +1,4 @@ -// test_output! [1,5,14] +//! test_output([1,5,14]) export default function main() { let x = 0; diff --git a/inputs/passing/nestedFn.ts b/inputs/passing/nestedFn.ts index ff6a388..1532ad6 100644 --- a/inputs/passing/nestedFn.ts +++ b/inputs/passing/nestedFn.ts @@ -1,4 +1,4 @@ -// test_output! 3 +//! test_output(3) export default function () { function foo() { diff --git a/inputs/passing/nestedFnCapture.ts b/inputs/passing/nestedFnCapture.ts index 9eb0cd9..a650e7e 100644 --- a/inputs/passing/nestedFnCapture.ts +++ b/inputs/passing/nestedFnCapture.ts @@ -1,4 +1,4 @@ -// test_output! 3 +//! test_output(3) export default function () { const x = 3; diff --git a/inputs/passing/numberMethods/isInteger.ts b/inputs/passing/numberMethods/isInteger.ts index abd6f68..eda6e7f 100644 --- a/inputs/passing/numberMethods/isInteger.ts +++ b/inputs/passing/numberMethods/isInteger.ts @@ -1,4 +1,4 @@ -// test_output! [[true,true,true,true,true,true,true],[false,false,false,false,false]] +//! test_output([[true,true,true,true,true,true,true],[false,false,false,false,false]]) export default function () { const integers = [ diff --git a/inputs/passing/numberMethods/isSafeInteger.ts b/inputs/passing/numberMethods/isSafeInteger.ts index 2b27349..c692377 100644 --- a/inputs/passing/numberMethods/isSafeInteger.ts +++ b/inputs/passing/numberMethods/isSafeInteger.ts @@ -1,4 +1,4 @@ -// test_output! [[true,true,true,true,true,true],[false,false,false,false,false,false]] +//! test_output([[true,true,true,true,true,true],[false,false,false,false,false,false]]) export default function () { const minSafe = -9007199254740991; diff --git a/inputs/passing/numberMethods/parseFloat.ts b/inputs/passing/numberMethods/parseFloat.ts index 9469a5e..dab4373 100644 --- a/inputs/passing/numberMethods/parseFloat.ts +++ b/inputs/passing/numberMethods/parseFloat.ts @@ -1,4 +1,4 @@ -// test_output! [[37,-37,37.1,37,37.1,1.5,0.1,1.23],[NaN]] +//! test_output([[37,-37,37.1,37,37.1,1.5,0.1,1.23],[NaN]]) export default function () { const numbers = [ diff --git a/inputs/passing/numberMethods/parseInt.ts b/inputs/passing/numberMethods/parseInt.ts index 359406e..915812c 100644 --- a/inputs/passing/numberMethods/parseInt.ts +++ b/inputs/passing/numberMethods/parseInt.ts @@ -1,4 +1,4 @@ -// test_output! [[37,-37,15,37,37,31],[NaN,NaN]] +//! test_output([[37,-37,15,37,37,31],[NaN,NaN]]) export default function () { const positive_and_negative = [ diff --git a/inputs/passing/numberMethods/toExponential.ts b/inputs/passing/numberMethods/toExponential.ts index 1ed610c..2bbe6b7 100644 --- a/inputs/passing/numberMethods/toExponential.ts +++ b/inputs/passing/numberMethods/toExponential.ts @@ -1,4 +1,4 @@ -// test_output! [["0e+0","1.2e+0","1.2e+1","1.2e+2","1.2e-1","1.2e-2","1.2e-3","1.2e-4"],["0.00e+0","1.23e+0","1.23e+1","1.23e-1","1.23e-2","1.23e-3","1.23e-4"],["NaN","Infinity"]] +//! test_output([["0e+0","1.2e+0","1.2e+1","1.2e+2","1.2e-1","1.2e-2","1.2e-3","1.2e-4"],["0.00e+0","1.23e+0","1.23e+1","1.23e-1","1.23e-2","1.23e-3","1.23e-4"],["NaN","Infinity"]]) export default function () { const withoutPrecision = [ diff --git a/inputs/passing/numberMethods/toFixed.ts b/inputs/passing/numberMethods/toFixed.ts index c61f17f..947a583 100644 --- a/inputs/passing/numberMethods/toFixed.ts +++ b/inputs/passing/numberMethods/toFixed.ts @@ -1,4 +1,4 @@ -// test_output! [["0.00","1.23","123.00","0.01","0.00123","12345.68","3.14","-1.00"],["NaN","Infinity"]] +//! test_output([["0.00","1.23","123.00","0.01","0.00123","12345.68","3.14","-1.00"],["NaN","Infinity"]]) export default function () { const positive = [ diff --git a/inputs/passing/patternEvalOrder.ts b/inputs/passing/patternEvalOrder.ts index 8c0acb0..8550dc7 100644 --- a/inputs/passing/patternEvalOrder.ts +++ b/inputs/passing/patternEvalOrder.ts @@ -1,4 +1,4 @@ -// test_output! "right" +//! test_output("right") export default function main() { let x; diff --git a/inputs/passing/patternEvalOrder2.ts b/inputs/passing/patternEvalOrder2.ts index febdfb3..32428d4 100644 --- a/inputs/passing/patternEvalOrder2.ts +++ b/inputs/passing/patternEvalOrder2.ts @@ -1,4 +1,4 @@ -// test_output! ["c","a","b"] +//! test_output(["c","a","b"]) export default function main() { let log: string[] = []; diff --git a/inputs/passing/preincrement.ts b/inputs/passing/preincrement.ts index d3bfc78..939eb53 100644 --- a/inputs/passing/preincrement.ts +++ b/inputs/passing/preincrement.ts @@ -1,4 +1,4 @@ -// test_output! 2 +//! test_output(2) export default function main() { let value = 1; diff --git a/inputs/passing/projEuler/p1.ts b/inputs/passing/projEuler/p1.ts index 2427078..e35f9e9 100644 --- a/inputs/passing/projEuler/p1.ts +++ b/inputs/passing/projEuler/p1.ts @@ -1,4 +1,4 @@ -// test_output! 233168 +//! test_output(233168) export default function main() { let sum = 0; diff --git a/inputs/passing/projEuler/p11.ts b/inputs/passing/projEuler/p11.ts index 84cafa8..6abb831 100644 --- a/inputs/passing/projEuler/p11.ts +++ b/inputs/passing/projEuler/p11.ts @@ -1,4 +1,4 @@ -// test_output! 70600674 +//! test_output(70600674) export default function main() { const grid = [ diff --git a/inputs/passing/projEuler/p13.ts b/inputs/passing/projEuler/p13.ts index d25915e..0a441a8 100644 --- a/inputs/passing/projEuler/p13.ts +++ b/inputs/passing/projEuler/p13.ts @@ -1,4 +1,4 @@ -// test_output! "Probably 5537376230 (trailing digits: 39036)" +//! test_output("Probably 5537376230 (trailing digits: 39036)") export default function main() { const numStrs = [ diff --git a/inputs/passing/projEuler/p15.ts b/inputs/passing/projEuler/p15.ts index 5ddc773..413db40 100644 --- a/inputs/passing/projEuler/p15.ts +++ b/inputs/passing/projEuler/p15.ts @@ -1,4 +1,4 @@ -// test_output! 137846528820 +//! test_output(137846528820) export default function main() { let rc = new RouteCalculator(); diff --git a/inputs/passing/projEuler/p16.ts b/inputs/passing/projEuler/p16.ts index 7a96621..3e7584e 100644 --- a/inputs/passing/projEuler/p16.ts +++ b/inputs/passing/projEuler/p16.ts @@ -1,4 +1,4 @@ -// test_output! 1366 +//! test_output(1366) import plus from "./helpers/plus.ts"; diff --git a/inputs/passing/projEuler/p18.ts b/inputs/passing/projEuler/p18.ts index 074bc1f..c9034f4 100644 --- a/inputs/passing/projEuler/p18.ts +++ b/inputs/passing/projEuler/p18.ts @@ -1,4 +1,4 @@ -// test_output! 1074 +//! test_output(1074) export default function main() { let tower = [ diff --git a/inputs/passing/projEuler/p19.ts b/inputs/passing/projEuler/p19.ts index 09737ee..260bdbf 100644 --- a/inputs/passing/projEuler/p19.ts +++ b/inputs/passing/projEuler/p19.ts @@ -1,4 +1,4 @@ -// test_output! 171 +//! test_output(171) declare const Debug: { log: (...args: unknown[]) => undefined; diff --git a/inputs/passing/projEuler/p2.ts b/inputs/passing/projEuler/p2.ts index a276708..2ba4a0d 100644 --- a/inputs/passing/projEuler/p2.ts +++ b/inputs/passing/projEuler/p2.ts @@ -1,4 +1,4 @@ -// test_output! 4613732 +//! test_output(4613732) export default function main() { let sum = 0; diff --git a/inputs/passing/projEuler/p25.ts b/inputs/passing/projEuler/p25.ts index 195d95b..57123ca 100644 --- a/inputs/passing/projEuler/p25.ts +++ b/inputs/passing/projEuler/p25.ts @@ -1,4 +1,4 @@ -// test_output! 4782 +//! test_output(4782) export default function main() { let fibLast = 1n; diff --git a/inputs/passing/projEuler/p3.ts b/inputs/passing/projEuler/p3.ts index 0e4ec76..f77e13b 100644 --- a/inputs/passing/projEuler/p3.ts +++ b/inputs/passing/projEuler/p3.ts @@ -1,4 +1,4 @@ -// test_output! [71,839,1471,6857] +//! test_output([71,839,1471,6857]) import { factorize } from "./helpers/primes.ts"; diff --git a/inputs/passing/projEuler/p4.ts b/inputs/passing/projEuler/p4.ts index cb449a0..1eed61f 100644 --- a/inputs/passing/projEuler/p4.ts +++ b/inputs/passing/projEuler/p4.ts @@ -1,4 +1,4 @@ -// test_output! 906609 +//! test_output(906609) export default function main() { let largest = 0; diff --git a/inputs/passing/projEuler/p5.ts b/inputs/passing/projEuler/p5.ts index 5cf0a4b..cd9fe44 100644 --- a/inputs/passing/projEuler/p5.ts +++ b/inputs/passing/projEuler/p5.ts @@ -1,4 +1,4 @@ -// test_output! 232792560 +//! test_output(232792560) import { factorize } from "./helpers/primes.ts"; diff --git a/inputs/passing/projEuler/p6.ts b/inputs/passing/projEuler/p6.ts index bf9095c..ff01d99 100644 --- a/inputs/passing/projEuler/p6.ts +++ b/inputs/passing/projEuler/p6.ts @@ -1,4 +1,4 @@ -// test_output! 25164150 +//! test_output(25164150) export default function main() { return squareOfSum(100) - sumOfSquares(100); diff --git a/inputs/passing/projEuler/p8.ts b/inputs/passing/projEuler/p8.ts index 3e01b67..abacea9 100644 --- a/inputs/passing/projEuler/p8.ts +++ b/inputs/passing/projEuler/p8.ts @@ -1,4 +1,4 @@ -// test_output! 23514624000 +//! test_output(23514624000) export default function main() { const digits = [ diff --git a/inputs/passing/projEuler/p9.ts b/inputs/passing/projEuler/p9.ts index 03ac0d6..c003f52 100644 --- a/inputs/passing/projEuler/p9.ts +++ b/inputs/passing/projEuler/p9.ts @@ -1,4 +1,4 @@ -// test_output! 31875000 +//! test_output(31875000) export default function main() { for (let a = 1; a <= 1000; a++) { diff --git a/inputs/passing/readme-demo.ts b/inputs/passing/readme-demo.ts index fe960dc..bc03a02 100644 --- a/inputs/passing/readme-demo.ts +++ b/inputs/passing/readme-demo.ts @@ -1,4 +1,4 @@ -// test_output! false +//! test_output(false) export default function main() { const leftBowl = ["apple", "mango"]; diff --git a/inputs/passing/recursiveCapture.ts b/inputs/passing/recursiveCapture.ts index e4bfe55..c1bf5e9 100644 --- a/inputs/passing/recursiveCapture.ts +++ b/inputs/passing/recursiveCapture.ts @@ -1,4 +1,4 @@ -// test_output! 120 +//! test_output(120) export default function main() { const one = 1; diff --git a/inputs/passing/shadow.ts b/inputs/passing/shadow.ts index 992a9cb..ebd14bf 100644 --- a/inputs/passing/shadow.ts +++ b/inputs/passing/shadow.ts @@ -1,4 +1,4 @@ -// test_output! 3 +//! test_output(3) export default function main() { let sum = 0; diff --git a/inputs/passing/spread.ts b/inputs/passing/spread.ts index c634757..7678a64 100644 --- a/inputs/passing/spread.ts +++ b/inputs/passing/spread.ts @@ -1,4 +1,4 @@ -// test_output! [".abc.",".abc.",".abc.",".abc."] +//! test_output([".abc.",".abc.",".abc.",".abc."]) export default function () { const middle = ["a", "b", "c"] as const; diff --git a/inputs/passing/spreadAndReturn.ts b/inputs/passing/spreadAndReturn.ts index 9c8fe57..3533690 100644 --- a/inputs/passing/spreadAndReturn.ts +++ b/inputs/passing/spreadAndReturn.ts @@ -1,4 +1,4 @@ -// // test_output! {} +// //! test_output({}) export default function () { let x = new X(); diff --git a/inputs/passing/stringIndexing.ts b/inputs/passing/stringIndexing.ts index cc80bce..51ac399 100644 --- a/inputs/passing/stringIndexing.ts +++ b/inputs/passing/stringIndexing.ts @@ -1,4 +1,4 @@ -// test_output! [undefined,"πŸš€","","","","🍹","","","","a","b","c","Β£","","ν•œ","","","🎨","","","",undefined] +//! test_output([undefined,"πŸš€","","","","🍹","","","","a","b","c","Β£","","ν•œ","","","🎨","","","",undefined]) export default function () { const str = "πŸš€πŸΉabcΒ£ν•œπŸŽ¨"; diff --git a/inputs/passing/stringIteration.ts b/inputs/passing/stringIteration.ts index f5f919e..05510be 100644 --- a/inputs/passing/stringIteration.ts +++ b/inputs/passing/stringIteration.ts @@ -1,4 +1,4 @@ -// test_output! ["πŸš€","🍹","a","b","c","Β£","ν•œ","🎨"] +//! test_output(["πŸš€","🍹","a","b","c","Β£","ν•œ","🎨"]) export default function () { const str = "πŸš€πŸΉabcΒ£ν•œπŸŽ¨"; diff --git a/inputs/passing/stringMethods/at.ts b/inputs/passing/stringMethods/at.ts index e75693c..b118619 100644 --- a/inputs/passing/stringMethods/at.ts +++ b/inputs/passing/stringMethods/at.ts @@ -1,4 +1,4 @@ -// test_output! "r" +//! test_output("r") export default function() { return "foobar".at(-1); diff --git a/inputs/passing/stringMethods/codePointAt.ts b/inputs/passing/stringMethods/codePointAt.ts index a323236..e2a43a0 100644 --- a/inputs/passing/stringMethods/codePointAt.ts +++ b/inputs/passing/stringMethods/codePointAt.ts @@ -1,4 +1,4 @@ -// test_output! [128640,undefined,undefined,undefined,127865,undefined,undefined,undefined,97,98,99,163,undefined,54620,undefined,undefined,127912,undefined,undefined,undefined] +//! test_output([128640,undefined,undefined,undefined,127865,undefined,undefined,undefined,97,98,99,163,undefined,54620,undefined,undefined,127912,undefined,undefined,undefined]) // ValueScript uses utf8, so it deviates from JavaScript's utf16. // We're also not really doing the utf8 equivalent of JavaScript's utf16 either. diff --git a/inputs/passing/stringMethods/endsWith.ts b/inputs/passing/stringMethods/endsWith.ts index 56111ac..b0a07ae 100644 --- a/inputs/passing/stringMethods/endsWith.ts +++ b/inputs/passing/stringMethods/endsWith.ts @@ -1,4 +1,4 @@ -// test_output! [true,false,true,true,true,true,false,true,true,false] +//! test_output([true,false,true,true,true,true,false,true,true,false]) export default function () { return [ diff --git a/inputs/passing/stringMethods/fromCodePoint.ts b/inputs/passing/stringMethods/fromCodePoint.ts index 717bf5c..35acb9a 100644 --- a/inputs/passing/stringMethods/fromCodePoint.ts +++ b/inputs/passing/stringMethods/fromCodePoint.ts @@ -1,4 +1,4 @@ -// test_output! "Hi πŸ‘‹" +//! test_output("Hi πŸ‘‹") export default function () { return String.fromCodePoint(72, 105, 32, 128075); diff --git a/inputs/passing/stringMethods/includes.ts b/inputs/passing/stringMethods/includes.ts index 7e842ea..2a2605c 100644 --- a/inputs/passing/stringMethods/includes.ts +++ b/inputs/passing/stringMethods/includes.ts @@ -1,4 +1,4 @@ -// test_output! [[true,true,true,true,true,true],[false,false,false,false]] +//! test_output([[true,true,true,true,true,true],[false,false,false,false]]) export default function () { const positive = [ diff --git a/inputs/passing/stringMethods/indexOf.ts b/inputs/passing/stringMethods/indexOf.ts index 9ee64d6..23208d5 100644 --- a/inputs/passing/stringMethods/indexOf.ts +++ b/inputs/passing/stringMethods/indexOf.ts @@ -1,4 +1,4 @@ -// test_output! [[0,3,1,0,0,3],[-1,-1,-1,-1]] +//! test_output([[0,3,1,0,0,3],[-1,-1,-1,-1]]) export default function () { const positive = [ diff --git a/inputs/passing/stringMethods/lastIndexOf.ts b/inputs/passing/stringMethods/lastIndexOf.ts index 2f4088c..bc30b53 100644 --- a/inputs/passing/stringMethods/lastIndexOf.ts +++ b/inputs/passing/stringMethods/lastIndexOf.ts @@ -1,4 +1,4 @@ -// test_output! [[4,2,4,6],[-1,-1]] +//! test_output([[4,2,4,6],[-1,-1]]) export default function () { const positive = [ diff --git a/inputs/passing/stringMethods/padEnd.ts b/inputs/passing/stringMethods/padEnd.ts index 7b23359..293ea49 100644 --- a/inputs/passing/stringMethods/padEnd.ts +++ b/inputs/passing/stringMethods/padEnd.ts @@ -1,4 +1,4 @@ -// test_output! ["foo ","πŸš€","πŸš€","πŸš€","πŸš€","πŸš€","πŸš€πŸš€","πŸš€πŸš€","abc12","abc123","abc1231","abc12312"] +//! test_output(["foo ","πŸš€","πŸš€","πŸš€","πŸš€","πŸš€","πŸš€πŸš€","πŸš€πŸš€","abc12","abc123","abc1231","abc12312"]) export default function () { return [ diff --git a/inputs/passing/stringMethods/padStart.ts b/inputs/passing/stringMethods/padStart.ts index 1fc0986..f2bb54f 100644 --- a/inputs/passing/stringMethods/padStart.ts +++ b/inputs/passing/stringMethods/padStart.ts @@ -1,4 +1,4 @@ -// test_output! [" foo","πŸš€","πŸš€","πŸš€","πŸš€","πŸš€","πŸš€πŸš€","πŸš€πŸš€","12abc","123abc","1231abc","12312abc"] +//! test_output([" foo","πŸš€","πŸš€","πŸš€","πŸš€","πŸš€","πŸš€πŸš€","πŸš€πŸš€","12abc","123abc","1231abc","12312abc"]) export default function () { return [ diff --git a/inputs/passing/stringMethods/repeat.ts b/inputs/passing/stringMethods/repeat.ts index 7e38c76..08e7670 100644 --- a/inputs/passing/stringMethods/repeat.ts +++ b/inputs/passing/stringMethods/repeat.ts @@ -1,4 +1,4 @@ -// test_output! "foofoofoo" +//! test_output("foofoofoo") export default function () { return "foo".repeat(3); diff --git a/inputs/passing/stringMethods/slice.ts b/inputs/passing/stringMethods/slice.ts index 001bff1..8524c82 100644 --- a/inputs/passing/stringMethods/slice.ts +++ b/inputs/passing/stringMethods/slice.ts @@ -1,4 +1,4 @@ -// test_output! ["","","","🎨","🎨","🎨","ν•œπŸŽ¨","ν•œπŸŽ¨","🍹abcΒ£ν•œ","πŸš€πŸΉabcΒ£ν•œπŸŽ¨","πŸš€πŸΉabcΒ£ν•œπŸŽ¨","πŸš€πŸΉabcΒ£ν•œπŸŽ¨",""] +//! test_output(["","","","🎨","🎨","🎨","ν•œπŸŽ¨","ν•œπŸŽ¨","🍹abcΒ£ν•œ","πŸš€πŸΉabcΒ£ν•œπŸŽ¨","πŸš€πŸΉabcΒ£ν•œπŸŽ¨","πŸš€πŸΉabcΒ£ν•œπŸŽ¨",""]) export default function () { const str = "πŸš€πŸΉabcΒ£ν•œπŸŽ¨"; diff --git a/inputs/passing/stringMethods/split.ts b/inputs/passing/stringMethods/split.ts index 8a960a3..359c4d0 100644 --- a/inputs/passing/stringMethods/split.ts +++ b/inputs/passing/stringMethods/split.ts @@ -1,4 +1,4 @@ -// test_output! [["πŸš€","🍹","a","b","c","Β£","ν•œ","🎨"],["f","","bar"],["","bar"],["foo",""],["one","two","three"]] +//! test_output([["πŸš€","🍹","a","b","c","Β£","ν•œ","🎨"],["f","","bar"],["","bar"],["foo",""],["one","two","three"]]) export default function () { return [ diff --git a/inputs/passing/stringMethods/startsWith.ts b/inputs/passing/stringMethods/startsWith.ts index 77c2f98..e2555b8 100644 --- a/inputs/passing/stringMethods/startsWith.ts +++ b/inputs/passing/stringMethods/startsWith.ts @@ -1,4 +1,4 @@ -// test_output! [[true,false,true,false,false,true]] +//! test_output([[true,false,true,false,false,true]]) export default function () { const startsWithTests = [ diff --git a/inputs/passing/stringMethods/substring.ts b/inputs/passing/stringMethods/substring.ts index e122915..218949b 100644 --- a/inputs/passing/stringMethods/substring.ts +++ b/inputs/passing/stringMethods/substring.ts @@ -1,4 +1,4 @@ -// test_output! [["abc","de","abcde","cde","bcd"],["","abc",""],["abc","cde","bcd"]] +//! test_output([["abc","de","abcde","cde","bcd"],["","abc",""],["abc","cde","bcd"]]) export default function () { const positive = [ diff --git a/inputs/passing/stringMethods/toLowerCase.ts b/inputs/passing/stringMethods/toLowerCase.ts index 2133d42..b80c7bc 100644 --- a/inputs/passing/stringMethods/toLowerCase.ts +++ b/inputs/passing/stringMethods/toLowerCase.ts @@ -1,4 +1,4 @@ -// test_output! [["abc","xyz","a1b2c3","hello world","Ñéíóú"]] +//! test_output([["abc","xyz","a1b2c3","hello world","Ñéíóú"]]) export default function () { const toLowerCaseTests = [ diff --git a/inputs/passing/stringMethods/toUpperCase.ts b/inputs/passing/stringMethods/toUpperCase.ts index 5810ef8..822fdaf 100644 --- a/inputs/passing/stringMethods/toUpperCase.ts +++ b/inputs/passing/stringMethods/toUpperCase.ts @@ -1,4 +1,4 @@ -// test_output! [["ABC","XYZ","A1B2C3","HELLO WORLD","ΓΓ‰ΓΓ“Γš"]] +//! test_output([["ABC","XYZ","A1B2C3","HELLO WORLD","ΓΓ‰ΓΓ“Γš"]]) export default function () { const toUpperCaseTests = [ diff --git a/inputs/passing/stringMethods/trim.ts b/inputs/passing/stringMethods/trim.ts index e9c9720..c8266ca 100644 --- a/inputs/passing/stringMethods/trim.ts +++ b/inputs/passing/stringMethods/trim.ts @@ -1,4 +1,4 @@ -// test_output! [["abc","abc","abc","a b c",""]] +//! test_output([["abc","abc","abc","a b c",""]]) export default function () { const trimTests = [ diff --git a/inputs/passing/stringMethods/trimEnd.ts b/inputs/passing/stringMethods/trimEnd.ts index a35fa42..e30f167 100644 --- a/inputs/passing/stringMethods/trimEnd.ts +++ b/inputs/passing/stringMethods/trimEnd.ts @@ -1,4 +1,4 @@ -// test_output! [["abc"," abc"," abc"," a b c",""]] +//! test_output([["abc"," abc"," abc"," a b c",""]]) export default function () { const trimEndTests = [ diff --git a/inputs/passing/stringMethods/trimStart.ts b/inputs/passing/stringMethods/trimStart.ts index 14ed558..eacf7c2 100644 --- a/inputs/passing/stringMethods/trimStart.ts +++ b/inputs/passing/stringMethods/trimStart.ts @@ -1,4 +1,4 @@ -// test_output! [["abc","abc ","abc ","a b c ",""]] +//! test_output([["abc","abc ","abc ","a b c ",""]]) export default function () { const trimStartTests = [ diff --git a/inputs/passing/swap.ts b/inputs/passing/swap.ts index aa65582..be04830 100644 --- a/inputs/passing/swap.ts +++ b/inputs/passing/swap.ts @@ -1,4 +1,4 @@ -// test_output! ["b","a"] +//! test_output(["b","a"]) export default function main() { let x = ["a", "b"]; diff --git a/inputs/passing/testBinaryTree.ts b/inputs/passing/testBinaryTree.ts index 7096ca1..fca5d40 100644 --- a/inputs/passing/testBinaryTree.ts +++ b/inputs/passing/testBinaryTree.ts @@ -1,4 +1,4 @@ -// test_output! [[1,2,5],[1,2,3,4,5]] +//! test_output([[1,2,5],[1,2,3,4,5]]) import BinaryTree from "./helpers/BinaryTree.ts"; diff --git a/inputs/passing/transitiveCapture.ts b/inputs/passing/transitiveCapture.ts index d59296a..4d66305 100644 --- a/inputs/passing/transitiveCapture.ts +++ b/inputs/passing/transitiveCapture.ts @@ -1,4 +1,4 @@ -// test_output! 3 +//! test_output(3) export default function main() { const x = 3; diff --git a/vstc/src/test_inputs.rs b/vstc/src/test_inputs.rs index 4e30b54..e0e93b8 100644 --- a/vstc/src/test_inputs.rs +++ b/vstc/src/test_inputs.rs @@ -33,13 +33,19 @@ mod tests { let file_contents = fs::read_to_string(&file_path).expect("Failed to read file contents"); if let Some(first_line) = file_contents.lines().next() { - if first_line.starts_with("// test_output! ") { + if first_line.starts_with("//! test_output(") { println!("\nTesting {} ...", file_path.to_str().unwrap()); - let output_str = first_line - .split_once("// test_output! ") + let mut output_string = first_line + .split_once("//! test_output(") .map(|x| x.1) - .unwrap_or(""); + .unwrap_or("") + .to_string(); + + if output_string.pop() != Some(')') { + println!(" Bad test_output format"); + failed_paths.insert(file_path.clone()); + } let resolved_path = resolve_entry_path( &file_path @@ -86,15 +92,15 @@ mod tests { let result = vm.run(bytecode, Some(2_000_000), &[]); - let result_str = match result { + let result_string = match result { Ok(val) => val.codify(), Err(err) => format!("E: {}", err.codify()), }; - if result_str != output_str { + if result_string != output_string { println!( " Expected: \"{}\"\n Actual: \"{}\"\n", - output_str, result_str, + output_string, result_string, ); failed_paths.insert(file_path.clone());