ValueScript icon indicating copy to clipboard operation
ValueScript copied to clipboard

Test diagnostics

Open voltrevo opened this issue 1 year ago • 0 comments

I'd like files in inputs/** to be able to be annotated with diagnostics for automated testing, similar to how test_output! works.

For example, I'd like to be able to change inputs/passing/captureMutated.ts to this:

export default function main() {
  let x = 0;
  x++; //! lint(cap-const)

  function foo() {
    return x; //! error(cap-mutate)
  }

  return foo();
}

If extra diagnostics are generated that aren't annotated in the source, it shouldn't fail the file. An extra directive that claims the diagnostic annotations are complete would be nice though.

next-line versions of these annotations would also be good.

voltrevo avatar Mar 08 '23 04:03 voltrevo