From 42e93ac5f6aeda7b586e4568823ad89ac6099997 Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Fri, 20 Oct 2023 17:00:17 -0600 Subject: [PATCH] pr fixes --- .github/workflows/test.yml | 1 + .../arbitraries/candid/primitive/floats/float32_arb.ts | 3 +++ property_tests/tests/float32/src/.gitkeep | 0 property_tests/tests/float32/test/test.ts | 7 ++++--- 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 property_tests/arbitraries/candid/primitive/floats/float32_arb.ts delete mode 100644 property_tests/tests/float32/src/.gitkeep diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3911314d0d..008e9e5627 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/float32", "property_tests/tests/int", "property_tests/tests/int8", "property_tests/tests/int16", diff --git a/property_tests/arbitraries/candid/primitive/floats/float32_arb.ts b/property_tests/arbitraries/candid/primitive/floats/float32_arb.ts new file mode 100644 index 0000000000..348effebc4 --- /dev/null +++ b/property_tests/arbitraries/candid/primitive/floats/float32_arb.ts @@ -0,0 +1,3 @@ +import fc from 'fast-check'; + +export const Float32Arb = fc.float(); diff --git a/property_tests/tests/float32/src/.gitkeep b/property_tests/tests/float32/src/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/property_tests/tests/float32/test/test.ts b/property_tests/tests/float32/test/test.ts index 48083ac9a1..a30dd43537 100644 --- a/property_tests/tests/float32/test/test.ts +++ b/property_tests/tests/float32/test/test.ts @@ -3,9 +3,10 @@ import { getCanisterId } from '../../../../test'; import { createUniquePrimitiveArb } from '../../../arbitraries/unique_primitive_arb'; import { JsFunctionNameArb } from '../../../arbitraries/js_function_name_arb'; import { runPropTests } from '../../..'; +import { Float32Arb } from '../../../arbitraries/candid/primitive/floats/float32_arb'; -const Nat8TestArb = fc - .tuple(createUniquePrimitiveArb(JsFunctionNameArb), fc.array(fc.float())) +const float32TestArb = fc + .tuple(createUniquePrimitiveArb(JsFunctionNameArb), fc.array(Float32Arb)) .map(([functionName, float32s]) => { const paramCandidTypes = float32s.map(() => 'float32').join(', '); const returnCandidType = 'float32'; @@ -65,4 +66,4 @@ const Nat8TestArb = fc }; }); -runPropTests(Nat8TestArb); +runPropTests(float32TestArb);