From 8795a5acca774892357338e5c9df63d28433ad7e Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Fri, 20 Oct 2023 16:56:41 -0600 Subject: [PATCH] pr fixes --- .github/workflows/test.yml | 1 + property_tests/tests/bool/src/.gitkeep | 0 property_tests/tests/bool/test/test.ts | 8 +++----- 3 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 property_tests/tests/bool/src/.gitkeep diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3911314d0d..5db9250d20 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -131,6 +131,7 @@ jobs: "examples/update", "examples/vanilla_js", "property_tests/tests/blob", + "property_tests/tests/boolean", "property_tests/tests/int", "property_tests/tests/int8", "property_tests/tests/int16", diff --git a/property_tests/tests/bool/src/.gitkeep b/property_tests/tests/bool/src/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/property_tests/tests/bool/test/test.ts b/property_tests/tests/bool/test/test.ts index a07b92e4ec..bc97087558 100644 --- a/property_tests/tests/bool/test/test.ts +++ b/property_tests/tests/bool/test/test.ts @@ -11,18 +11,16 @@ const BoolTestArb = fc const returnCandidType = 'bool'; const paramNames = bools.map((_, index) => `param${index}`); - const paramsAreNumbers = paramNames + const paramsAreBooleans = paramNames .map((paramName) => { return `if (typeof ${paramName} !== 'boolean') throw new Error('${paramName} must be a boolean');`; }) .join('\n'); - const paramsAnd = paramNames.reduce((acc, paramName) => { + const returnStatement = paramNames.reduce((acc, paramName) => { return `${acc} && ${paramName}`; }, 'true'); - const returnStatement = `${paramsAnd}`; - const expectedResult = bools.reduce((acc, bool) => acc && bool, true); const paramSamples = bools; @@ -43,7 +41,7 @@ const BoolTestArb = fc body: ` ${paramsCorrectlyOrdered} - ${paramsAreNumbers} + ${paramsAreBooleans} return ${returnStatement}; `,