Skip to content

Commit a51a6c1

Browse files
author
Johan Wiltink
committed
update workspace for imports redesign
1 parent 476403f commit a51a6c1

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

workspace/files.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

workspace/lc-test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// lc-test.js
2+
3+
import {readFileSync} from "fs";
4+
const read = (path) => readFileSync(new URL(path, import.meta.url), {encoding: "utf8"});
5+
6+
export const getSolution = () => read("./solution.lc");
7+
export const getPreloaded = () => read("./preloaded.lc");
8+
export const getPreloadedAndSolution = () => getPreloaded() + '\n' + getSolution() ; // this might as well check solution doesn't start with a continued line
9+
10+
export {assert,config} from "chai";
11+
12+
export * as LC from "@codewars/lambda-calculus";

workspace/test.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { assert, config as chaiConfig } from "chai";
2-
chaiConfig.truncateThreshold = 0;
1+
// test.js
32

4-
import * as LC from "@codewars/lambda-calculus";
5-
import { solution } from "./files.js"; // /workspace/files.js
3+
import * as LC from "./lc-test.js";
4+
LC.config.truncateThreshold = 0;
5+
LC.configure({ purity: "Let", numEncoding: "Church" });
66

7-
LC.config.purity = "Let";
8-
LC.config.numEncoding = "Church";
9-
const toInt = LC.toIntWith(LC.config);
10-
const { counter } = LC.compile(solution());
7+
const {counter} = LC.compile(getSolution());
8+
const {toInt} = LC;
119

1210
const T = t => _ => t;
1311
const F = _ => f => f;

0 commit comments

Comments
 (0)