2019-02-05 20:42:35 -08:00
|
|
|
import * as assert from 'assert';
|
2022-02-26 18:07:39 -08:00
|
|
|
import { just, nothing } from '../../src/prelude/maybe.js';
|
2019-02-05 20:42:35 -08:00
|
|
|
|
|
|
|
describe('just', () => {
|
|
|
|
it('has a value', () => {
|
|
|
|
assert.deepStrictEqual(just(3).isJust(), true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('has the inverse called get', () => {
|
|
|
|
assert.deepStrictEqual(just(3).get(), 3);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('nothing', () => {
|
|
|
|
it('has no value', () => {
|
|
|
|
assert.deepStrictEqual(nothing().isJust(), false);
|
|
|
|
});
|
|
|
|
});
|