From bf29a3af9cb669d46d7baf511063f8ee8e3f2c66 Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Tue, 19 Dec 2023 11:20:01 -0800 Subject: [PATCH] fix(exo): review suggestions --- packages/exo/test/test-amplify-heap-class-kits.js | 15 +++------------ packages/exo/test/test-revoke-heap-classes.js | 10 ++-------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/packages/exo/test/test-amplify-heap-class-kits.js b/packages/exo/test/test-amplify-heap-class-kits.js index 2900d02426..06544866ed 100644 --- a/packages/exo/test/test-amplify-heap-class-kits.js +++ b/packages/exo/test/test-amplify-heap-class-kits.js @@ -8,21 +8,14 @@ import { M } from '@endo/patterns'; import { defineExoClass, defineExoClassKit } from '../src/exo-makers.js'; const UpCounterI = M.interface('UpCounter', { - incr: M.call() - // TODO M.number() should not be needed to get a better error message - .optional(M.and(M.number(), M.gte(0))) - .returns(M.number()), + incr: M.call().optional(M.gte(0)).returns(M.number()), }); const DownCounterI = M.interface('DownCounter', { - decr: M.call() - // TODO M.number() should not be needed to get a better error message - .optional(M.and(M.number(), M.gte(0))) - .returns(M.number()), + decr: M.call().optional(M.gte(0)).returns(M.number()), }); test('test amplify defineExoClass fails', t => { - // let amp; t.throws( () => defineExoClass( @@ -38,9 +31,7 @@ test('test amplify defineExoClass fails', t => { }, }, { - receiveAmplifier(a) { - // amp = a; - }, + receiveAmplifier(_) {}, }, ), { diff --git a/packages/exo/test/test-revoke-heap-classes.js b/packages/exo/test/test-revoke-heap-classes.js index 5f2c81c581..cc5a0befd7 100644 --- a/packages/exo/test/test-revoke-heap-classes.js +++ b/packages/exo/test/test-revoke-heap-classes.js @@ -8,17 +8,11 @@ import { defineExoClass, defineExoClassKit } from '../src/exo-makers.js'; const { apply } = Reflect; const UpCounterI = M.interface('UpCounter', { - incr: M.call() - // TODO M.number() should not be needed to get a better error message - .optional(M.and(M.number(), M.gte(0))) - .returns(M.number()), + incr: M.call().optional(M.gte(0)).returns(M.number()), }); const DownCounterI = M.interface('DownCounter', { - decr: M.call() - // TODO M.number() should not be needed to get a better error message - .optional(M.and(M.number(), M.gte(0))) - .returns(M.number()), + decr: M.call().optional(M.gte(0)).returns(M.number()), }); test('test revoke defineExoClass', t => {