From 21ce098f98b3d0ea12f9b23c22ac838e173813cc Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Wed, 3 Aug 2022 10:20:34 -0700 Subject: [PATCH] test(templates): Check that unjoinable types are detected --- test/custom.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/custom.mjs b/test/custom.mjs index a5eece7..d232dd5 100644 --- a/test/custom.mjs +++ b/test/custom.mjs @@ -136,5 +136,10 @@ describe('A custom instance', () => { // sake of catching new specializations). Not sure whether that will be // OK or a problem that will have to be dealt with. assert.strictEqual(inst.typeMerge(3, 3n), 'Merge to Complex') + // But types that truly cannot be merged should throw a TypeError + // Should add a variation of this with a more usual type once there is + // one not interconvertible with others... + inst.install(genericSubtract) + assert.throws(() => inst.typeMerge(3, undefined), TypeError) }) })