File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ foo = \ x j c . x c ()
Original file line number Diff line number Diff line change 1+ import { readFileSync } from "fs" ;
2+ import { assert , config as chaiConfig } from "chai" ;
3+ chaiConfig . truncateThreshold = 0 ;
4+
5+ import * as LC from "../../src/lambda-calculus.js" ;
6+ LC . configure ( { purity : "Let" , numEncoding : "None" } ) ;
7+
8+ const solutionText = readFileSync ( new URL ( "./solution.txt" , import . meta. url ) , { encoding : "utf8" } ) ;
9+ const { foo } = LC . compile ( solutionText ) ;
10+
11+ describe ( "No side effects" , ( ) => {
12+ it ( "The initial failed call used to cause the second call to behave weirdly" , ( ) => {
13+ try {
14+ foo ( "hi" ) ( "there" ) ( "world" )
15+ } catch { }
16+ assert . strictEqual ( foo ( null ) . term . toString ( ) , "\\ j c . x c ()" ) ;
17+ } ) ;
18+ } ) ;
You can’t perform that action at this time.
0 commit comments