aboutsummaryrefslogtreecommitdiff
path: root/src/eval-env/test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval-env/test.ts')
-rw-r--r--src/eval-env/test.ts17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/eval-env/test.ts b/src/eval-env/test.ts
index 84ae138..4dd8c8d 100644
--- a/src/eval-env/test.ts
+++ b/src/eval-env/test.ts
@@ -2,7 +2,7 @@ import { Type } from 'ts-morph'
import { Ctx } from '../types'
export default (ctx: Ctx, args: Type[]) => ({
- Test: async () => {
+ Test: ctx.withScope(async () => {
const [msg, effs] = args
process.stdout.write(` - ${ctx.getTypeValue(msg)} `)
@@ -13,12 +13,12 @@ export default (ctx: Ctx, args: Type[]) => ({
console.log('[✓]')
} catch (e) {
- console.log('[TEST FAILED]')
+ // console.log('[TEST FAILED]')
throw e
}
return []
- },
+ }),
Assert: async () => {
if (!ctx.getTypeValue(args[0])) {
@@ -27,4 +27,15 @@ export default (ctx: Ctx, args: Type[]) => ({
return []
},
+
+ ShowAssertionError: async () => {
+ const [left, right] = args
+ console.log()
+ console.log(' | Assertion error:')
+ console.log(' | - Left: ', ctx.typeToString(left))
+ console.log(' | - Right:', ctx.typeToString(right))
+ console.log()
+
+ return []
+ },
})