From b738e6cfd191f2cebacc2edf4d0bf01e7cc99f55 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Tue, 28 Oct 2025 22:23:49 -0700 Subject: [PATCH] use -> load --- src/prelude/index.ts | 2 +- src/prelude/tests/{use.test.ts => load.ts} | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) rename src/prelude/tests/{use.test.ts => load.ts} (71%) 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) })