You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
961 B

import { VM, run, libBasic } from "cumlisp"
import test from "./index.js"
const vm = new VM()
libBasic.installBasic(vm)
test(vm)
//is it funny that we're testing the unit testing with the unit testing?
//
//yes
/*console.log(await run(`%(
(set x "deez")
(assertTrue "Successful assertion to true" (equals 1 1))
(assertTrue "Failed assertion to true" (equals 1 0))
(assertTrue "Assertion with variables and strings" (equals (x) "deez"))
)`, vm))*/
console.log(await run(`%(
(set x "deez")
(set y "deez")
(set z "nuts")
(testWrapper
(testSet "assertTrue"
(assertTrue "assertTrue success" (equals 1 1))
(assertTrue "assertTrue fail" (equals 1 0))
(assertTrue "assertTrue success with strings" (equals (x) "deez")))
(testSet "assertEquals"
(assertEquals "assertEquals success" (x) (y))
(assertEquals "assertEquals failure" (x) (z)))
(testSet "Miscellaneous"
(assertTrue "libBasic comparison functions" (== (x) (y))))
)
)`, vm))