plsandbox/stlc/index.test.ts

20 lines
542 B
TypeScript
Raw Normal View History

2024-05-11 07:49:40 +00:00
import fc from "fast-check";
import { describe, expect, test } from "bun:test";
import { churchEncode, inferType, prettyTerm, prettyType } from ".";
// Code under test
const contains = (text, pattern) => text.indexOf(pattern) >= 0;
// Properties
describe("church encoding", () => {
test("well typed", () => {
fc.assert(
fc.property(fc.integer(), (num) => {
const churchNum = churchEncode(num);
console.log(prettyTerm(churchNum));
console.log(prettyType(inferType(churchNum)));
}),
);
});
});