import { tsst, the } from 'tsst-tycho'; import { Bool } from '../src/util'; import { Not, And, Or, Indeterminate, Determinate, DefinitelyYes, DefinitelyNo, IsTruthy, IsFalsy } from '../src/boolean'; import { UnionHasKey } from '../src/union'; describe(`boolean`, () => { describe(`Not`, () => { it(`the<'1', Not<'0'>>`, () => { tsst(() => { the<'1', Not<'0'>>(); }).expectToCompile(); }); it(`the<'0', Not<'1'>>`, () => { tsst(() => { the<'0', Not<'1'>>(); }).expectToCompile(); }); xit(`the>`, () => { tsst(() => { the>(); }).expectToCompile(); }); xit(`the<'0', Not<'true'>>`, () => { tsst(() => { the<'0', Not<'true'>>(); }).expectToCompile(); }); xit(`the<'1', Not<'false'>>`, () => { tsst(() => { the<'1', Not<'false'>>(); }).expectToCompile(); }); xit(`the>`, () => { tsst(() => { the>(); }).expectToCompile(); }); it(`the>`, () => { tsst(() => { the>(); // any }).expectToCompile(); }); xit(`the<'0', Not>`, () => { tsst(() => { the<'0', Not>(); // any }).expectToCompile(); }); xit(`the<'1', Not>`, () => { tsst(() => { the<'1', Not>(); // any }).expectToCompile(); }); }); describe(`And`, () => { it(`the<'1', And<'1', '1'>>`, () => { tsst(() => { the<'1', And<'1', '1'>>(); }).expectToCompile(); }); it(`the<'0', And<'0', '1'>>`, () => { tsst(() => { the<'0', And<'0', '1'>>(); }).expectToCompile(); }); }); describe(`Or`, () => { it(`the<'1', Or<'1', '0'>>`, () => { tsst(() => { the<'1', Or<'1', '0'>>(); }).expectToCompile(); }); it(`the<'0', Or<'0', '0'>>`, () => { tsst(() => { the<'0', Or<'0', '0'>>(); }).expectToCompile(); }); }); describe(`UnionHasKey`, () => { it(`the<'1', UnionHasKey>`, () => { tsst(() => { the<'1', UnionHasKey>(); }).expectToCompile(); }); it(`the<'1', UnionHasKey>`, () => { tsst(() => { the<'1', UnionHasKey>(); }).expectToCompile(); }); it(`the<'1', UnionHasKey | UnionHasKey>`, () => { tsst(() => { the<'1', UnionHasKey | UnionHasKey>(); }).expectToCompile(); }); it(`the<'1', And, UnionHasKey>>`, () => { tsst(() => { the<'1', And, UnionHasKey>>(); }).expectToCompile(); }); }); describe(`Indeterminate`, () => { // ^ broke, along with dependents! // ^ regression in recent TS? it(`the<'1', Indeterminate>`, () => { tsst(() => { the<'1', Indeterminate>(); }).expectToCompile(); }); it(`the<'0', Indeterminate<'0'>>`, () => { tsst(() => { the<'0', Indeterminate<'0'>>(); }).expectToCompile(); }); it(`the<'0', Indeterminate<'1'>>`, () => { tsst(() => { the<'0', Indeterminate<'1'>>(); }).expectToCompile(); }); }); describe(`Determinate`, () => { it(`the<'0', Determinate>`, () => { tsst(() => { the<'0', Determinate>(); }).expectToCompile(); }); it(`the<'1', Determinate<'0'>>`, () => { tsst(() => { the<'1', Determinate<'0'>>(); }).expectToCompile(); }); it(`the<'1', Determinate<'1'>>`, () => { tsst(() => { the<'1', Determinate<'1'>>(); }).expectToCompile(); }); }); describe(`DefinitelyYes`, () => { it(`the<'0', DefinitelyYes>`, () => { tsst(() => { the<'0', DefinitelyYes>(); }).expectToCompile(); }); it(`the<'0', DefinitelyYes<'0'>>`, () => { tsst(() => { the<'0', DefinitelyYes<'0'>>(); }).expectToCompile(); }); it(`the<'1', DefinitelyYes<'1'>>`, () => { tsst(() => { the<'1', DefinitelyYes<'1'>>(); }).expectToCompile(); }); }); describe(`DefinitelyNo`, () => { it(`the<'0', DefinitelyNo>`, () => { tsst(() => { the<'0', DefinitelyNo>(); }).expectToCompile(); }); it(`the<'1', DefinitelyNo<'0'>>`, () => { tsst(() => { the<'1', DefinitelyNo<'0'>>(); }).expectToCompile(); }); it(`the<'0', DefinitelyNo<'1'>>`, () => { tsst(() => { the<'0', DefinitelyNo<'1'>>(); }).expectToCompile(); }); }); describe(`IsTruthy`, () => { it(`the<'1', IsTruthy>`, () => { tsst(() => { the<'1', IsTruthy>(); }).expectToCompile(); }); it(`the<'0', IsTruthy>`, () => { tsst(() => { the<'0', IsTruthy>(); }).expectToCompile(); }); it(`the<'1', IsTruthy<123>>`, () => { tsst(() => { the<'1', IsTruthy<123>>(); }).expectToCompile(); }); it(`the<'0', IsTruthy<0>>`, () => { tsst(() => { the<'0', IsTruthy<0>>(); }).expectToCompile(); }); it(`the, Bool>`, () => { tsst(() => { the, Bool>(); }).expectToCompile(); }); }); describe(`IsFalsy`, () => { it(`the<'0', IsFalsy>`, () => { tsst(() => { the<'0', IsFalsy>(); }).expectToCompile(); }); it(`the<'1', IsFalsy>`, () => { tsst(() => { the<'1', IsFalsy>(); }).expectToCompile(); }); it(`the<'0', IsFalsy<123>>`, () => { tsst(() => { the<'0', IsFalsy<123>>(); }).expectToCompile(); }); it(`the<'1', IsFalsy<0>>`, () => { tsst(() => { the<'1', IsFalsy<0>>(); }).expectToCompile(); }); it(`the, Bool>`, () => { tsst(() => { the, Bool>(); }).expectToCompile(); }); }); });