diff --git a/src/prelude/index.ts b/src/prelude/index.ts index a851706..df1cdaf 100644 --- a/src/prelude/index.ts +++ b/src/prelude/index.ts @@ -78,7 +78,7 @@ export const globalFunctions = { }, // modules - use: async function (this: VM, path: string): Promise> { + load: async function (this: VM, path: string): Promise> { const scope = this.scope const pc = this.pc diff --git a/src/prelude/tests/use.test.ts b/src/prelude/tests/load.ts similarity index 71% rename from src/prelude/tests/use.test.ts rename to src/prelude/tests/load.ts index a8ec265..374211f 100644 --- a/src/prelude/tests/use.test.ts +++ b/src/prelude/tests/load.ts @@ -4,38 +4,38 @@ import { globalFunctions } from '#prelude' describe('use', () => { test(`imports all a file's functions`, async () => { expect(` - math = use ./src/prelude/tests/math + math = load ./src/prelude/tests/math math.double 4 `).toEvaluateTo(8, globalFunctions) expect(` - math = use ./src/prelude/tests/math + math = load ./src/prelude/tests/math math.double (math.double 4) `).toEvaluateTo(16, globalFunctions) expect(` - math = use ./src/prelude/tests/math + math = load ./src/prelude/tests/math dbl = math.double dbl (dbl 2) `).toEvaluateTo(8, globalFunctions) expect(` - math = use ./src/prelude/tests/math + math = load ./src/prelude/tests/math math.pi `).toEvaluateTo(3.14, globalFunctions) expect(` - math = use ./src/prelude/tests/math + math = load ./src/prelude/tests/math math | at 🥧 `).toEvaluateTo(3.14159265359, globalFunctions) expect(` - math = use ./src/prelude/tests/math + math = load ./src/prelude/tests/math math.🥧 `).toEvaluateTo(3.14159265359, globalFunctions) expect(` - math = use ./src/prelude/tests/math + math = load ./src/prelude/tests/math math.add1 5 `).toEvaluateTo(6, globalFunctions) })