summaryrefslogtreecommitdiff
path: root/tests/type-consistency/spec/mapReduce.ts
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2025-11-09 21:52:06 -0800
committerKai Stevenson <kai@kaistevenson.com>2025-11-09 21:52:06 -0800
commit190f85ff1ac23f952a7b4960638fee79495e249a (patch)
treebb7616b31ea6ab0ef20e1b59536762d71ffbb2ae /tests/type-consistency/spec/mapReduce.ts
parent413eaa284e164143c5416cdce5a1de0f9f992409 (diff)
Diffstat (limited to 'tests/type-consistency/spec/mapReduce.ts')
-rw-r--r--tests/type-consistency/spec/mapReduce.ts34
1 files changed, 0 insertions, 34 deletions
diff --git a/tests/type-consistency/spec/mapReduce.ts b/tests/type-consistency/spec/mapReduce.ts
deleted file mode 100644
index b5077ff..0000000
--- a/tests/type-consistency/spec/mapReduce.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import path from "path";
-import { createTestHarness } from "../harness";
-
-export default createTestHarness({
- harnessName: "Map reduce",
- generatedPath: path.join(__dirname, "..", "generated"),
-})
- .createFunctionTest({
- name: "Map: numbers to string",
- program: "fn(a, map(a, fn(n, tostring(n))))",
- cases: [
- { input: [1, 2, 3], output: ["1", "2", "3"] },
- { input: [50], output: ["50"] },
- { input: [], output: [] },
- ],
- })
- .createFunctionTest({
- name: "Reduce: array length",
- program: "fn(a, reduce(a, fn(acc, add(acc, 1)), 0))",
- cases: [
- { input: [1, 2, 3], output: 3 },
- { input: ["hello", ["hello", "world"]], output: 2 },
- { input: [], output: 0 },
- ],
- })
- .createFunctionTest({
- name: "Reduce: sum of numbers times index",
- program: "fn(a, reduce(a, fn(acc, cur, idx, add(acc, mul(cur, idx))), 0))",
- cases: [
- { input: [1, 2, 3], output: 8 },
- { input: [], output: 0 },
- { input: [50, 10, 0], output: 10 },
- ],
- });