Skip to content

Commit

Permalink
Update Relevance TS test (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
kharus authored Sep 9, 2024
1 parent 684ea27 commit f8b8de2
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/unit/Relevance.spec.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
import { evaluate } from '@ps/AnyAll.Relevance';
import { Leaf, Marking } from '@ps/AnyAll.Types/index.js';
import { Just } from '@ps/Data.Maybe';
import { False, Leaf, Marking, True } from '@ps/AnyAll.Types/index.js';
import { singleton } from '@ps/Data.Map';

const keyString = 'key';
const keyLeaf = new Leaf('key');

function makeRightMarking(mark : boolean) {
const defaultR = new Just(mark);

return Marking(singleton(keyString)(defaultR));
function makeMarking(mark: any) {
return Marking(singleton(keyString)(mark));
}

describe('evaluate', () => {
it('right key present in marking and True', () => {
expect(
evaluate(makeRightMarking(true))(keyLeaf)
evaluate(makeMarking(True))(keyLeaf)
).toEqual(
new Just(true)
True
);
});

it('right key present in marking and False', () => {
expect(
evaluate(makeRightMarking(false))(keyLeaf)
evaluate(makeMarking(False))(keyLeaf)
).toEqual(
new Just(false)
False
);
});
});

0 comments on commit f8b8de2

Please sign in to comment.