File tree Expand file tree Collapse file tree 3 files changed +18
-17
lines changed
Expand file tree Collapse file tree 3 files changed +18
-17
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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" ;
Original file line number Diff line number Diff line change 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
1210const T = t => _ => t ;
1311const F = _ => f => f ;
You can’t perform that action at this time.
0 commit comments