Skip to content

Instantly share code, notes, and snippets.

@escherize
Last active June 16, 2023 19:46
Show Gist options
  • Save escherize/746a1bed8942c00da7e11c3aa42b18dc to your computer and use it in GitHub Desktop.
Save escherize/746a1bed8942c00da7e11c3aa42b18dc to your computer and use it in GitHub Desktop.
➜  janet-playground bat jam.janet
────┬────────────────────────────────────────
    │ File: jam.janet
────┼────────────────────────────────────────
  1 │ (use judge)
  2 │
  3 │ # Testing values
  4 │
  5 │ (defn double [x] (* x x))
  6 │
  7 │ (test (double 3) 9)
  8 │ (test (double -3) 23)
  9 │
 10 │ # Testing stdout value:
 11 │
 12 │ (defn printer [] (print "Hello"))
 13 │
 14 │ (test-stdout (printer))
────┴────────────────────────────────────────
➜  janet-playground judge -i
# jam.janet

- (test (double -3) 23)
+ (test (double -3) 9)

Verdict? [y]naAdqQ? ?

y - patch this test
n - do not patch this test
a - patch this and all subsequent tests in this file
A - patch this and all subsequent tests in all files
d - don't patch this or any subsequent tests in this file
q - quit, patching any selected tests
Q - abort: exit immediately without patching any files
? - print help

Verdict? [y]naAdqQ? y


- (test-stdout (printer))
+ (test-stdout (printer) `
+   Hello
+ `)

Verdict? [y]naAdqQ? y


1 passed 2 failed
➜  janet-playground judge -i
# jam.janet

3 passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment