aboutsummaryrefslogtreecommitdiff
path: root/src/eval-env
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2023-01-13 19:40:15 +0530
committerAkshay Nair <phenax5@gmail.com>2023-01-13 19:59:56 +0530
commit42f8c401dc9519bc8b2d386ce9eda072144a46d0 (patch)
treee886538eccbd47beaaf27deff69267bd8c7dd67d /src/eval-env
parent8ba316461d2dc0a1372af16836ce14ceabc2bf4f (diff)
downloadts-types-lang-42f8c401dc9519bc8b2d386ce9eda072144a46d0.tar.gz
ts-types-lang-42f8c401dc9519bc8b2d386ce9eda072144a46d0.zip
feat: refactors test runner
Diffstat (limited to '')
-rw-r--r--src/eval-env/builtins.ts1
-rw-r--r--src/eval-env/test.ts13
2 files changed, 7 insertions, 7 deletions
diff --git a/src/eval-env/builtins.ts b/src/eval-env/builtins.ts
index 3adde06..f9c4ce8 100644
--- a/src/eval-env/builtins.ts
+++ b/src/eval-env/builtins.ts
@@ -1,5 +1,6 @@
import { Type } from 'ts-morph'
import { Ctx } from "../types"
+import { evalList } from '../util'
export default (ctx: Ctx, args: Type[]) => ({
SetEvalEnvironment: async () => {
diff --git a/src/eval-env/test.ts b/src/eval-env/test.ts
index c394752..eddf366 100644
--- a/src/eval-env/test.ts
+++ b/src/eval-env/test.ts
@@ -1,31 +1,30 @@
import { Type } from 'ts-morph'
import { Ctx } from '../types'
-export const cleanup = () => {}
-
export default (ctx: Ctx, args: Type[]) => ({
Test: async () => {
const [msg, effs] = args
- process.stdout.write(` - ${ctx.getTypeValue(msg)}`)
+ process.stdout.write(` - ${ctx.getTypeValue(msg)} `)
try {
for (const eff of effs?.getTupleElements() ?? []) {
await ctx.evaluateType(ctx, eff)
}
- console.log(' [✓]')
+ console.log('[✓]')
} catch(e) {
- console.log(' [TEST FAILED]')
+ console.log('[TEST FAILED]')
throw e
}
+
return []
},
Assert: async () => {
- const [b] = args
- if (!ctx.getTypeValue(b)) {
+ if (!ctx.getTypeValue(args[0])) {
throw new Error('Assertion failed')
}
+
return []
},
})