unison/unison-src/builtin-tests/jit-tests.output.md
2024-06-27 17:21:42 -04:00

1.4 KiB

The runtime tests are hosted at https://share.unison-lang.org/@unison/runtime-tests/

If you want to add or update tests, you can create a branch of that project, and update the runtime_tests_version line in jit-tests.sh and CI.yaml

Before merging the PR on Github, we'll merge your branch on Share and restore runtime_tests_version to /main or maybe a release.

runtime-tests/selected> run.native tests

  ()

runtime-tests/selected> run.native tests.jit.only

  ()

Per Dan: It's testing a flaw in how we were sending code from a scratch file to the native runtime, when that happened multiple times. Related to the verifiable refs and recursive functions.

foo = do
  go : Nat ->{Exception} ()
  go = cases
    0 -> ()
    n -> go (decrement n)
  go 1000

  Loading changes detected in scratch.u.

  I found and typechecked these definitions in scratch.u. If you
  do an `add` or `update`, here's how your codebase would
  change:
  
    ⍟ These new definitions are ok to `add`:
    
      foo : '{Exception} ()

scratch/main> run.native foo

  ()

scratch/main> run.native foo

  ()

This can also only be tested by separately running this test, because it is exercising the protocol that ucm uses to talk to the jit during an exception.

runtime-tests/selected> run.native testBug

  💔💥
  
  I've encountered a call to builtin.bug with the following
  value:
  
    "testing"