Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c69a6e9

Browse files
committedMar 14, 2025·
fixup! use assertChecker
1 parent 305369b commit c69a6e9

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed
 

‎packages/ERTP/src/mathHelpers/setMathHelpers.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @jessie-check
22

33
import { Fail } from '@endo/errors';
4-
import { passStyleOf } from '@endo/pass-style';
4+
import { passStyleOf, assertChecker } from '@endo/pass-style';
55
import { isKey, assertKey, elementsHasSplit, kindOf } from '@endo/patterns';
66
import {
77
elementsIsSuperset,
@@ -60,8 +60,14 @@ export const setMathHelpers = harden({
6060
payload: [elementPatt, bound],
6161
} = rightBound;
6262
const result = [];
63-
elementsHasSplit(left, elementPatt, bound, undefined, undefined, result) ||
64-
Fail`specimen did not match has bound`;
63+
elementsHasSplit(
64+
left,
65+
elementPatt,
66+
bound,
67+
undefined,
68+
result,
69+
assertChecker,
70+
);
6571
return harden(result);
6672
},
6773
});

‎packages/ERTP/test/unitTests/mathHelpers/setBoundMathHelpers.test.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ test('set minus setBound', t => {
2424
t.deepEqual(m.subtract(mock(['a', 'b']), mock(M.has(M.any()))), mock(['a']));
2525

2626
t.throws(() => m.subtract(mock(['a', 'b']), mock(M.has(M.any(), 3n))), {
27-
message: 'specimen did not match has bound',
27+
message: 'Has only "[2n]" matches, but needs "[3n]"',
2828
});
2929

3030
t.throws(() => m.subtract(mock(['a', 'b']), mock(M.has('c', 1n))), {
31-
message: 'specimen did not match has bound',
31+
message: 'Has only "[0n]" matches, but needs "[1n]"',
32+
});
33+
34+
t.throws(() => m.subtract(mock(['a', 'b']), mock(M.has('c'))), {
35+
message: 'Has only "[0n]" matches, but needs "[1n]"',
3236
});
3337
});
3438

0 commit comments

Comments
 (0)
Please sign in to comment.