moy-fp
Version:
A functional programming library.
24 lines (20 loc) • 500 B
JavaScript
import __ from '../../src/Function/__'
/**
* ((a, b, ..., m) -> n) -> ((a, b, ..., m) -> Boolean)
*/
import complement from '../../src/Logic/complement'
test('complement(not using __), return true', () => {
expect(
complement(x => x - 3)(3)
).toBeTruthy()
})
test('complement(not using __), return false', () => {
expect(
complement(x => x - 3)(4)
).toBeFalsy()
})
test('complement(using __), return true', () => {
expect(
complement(__)(x => x - 3)(3)
).toBeTruthy()
})