ValueScript icon indicating copy to clipboard operation
ValueScript copied to clipboard

Add an input test case

Open voltrevo opened this issue 2 years ago • 0 comments

Input test cases for ValueScript are really simple.

All you have to do is write a program like this:

// test_output! "Hello world!"

export default function() {
  return "Hello world!";
}

and save it in inputs/passing or inputs/failing.

Passing means the program behaves as intended, failing means it does something else.

If your program throws an exception or otherwise panics, you can't use test_output!, but adding these programs is still very important.

If your program does run to completion, even if the output is wrong, use test_output! and include the incorrect output. Add a comment below that saying what the output should be instead.

(By the way, exceptions shouldn't panic... they just currently do.)

voltrevo avatar Mar 08 '23 04:03 voltrevo