Skip to content

Commit

Permalink
pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Oct 20, 2023
1 parent 4573763 commit 42e93ac
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import fc from 'fast-check';

export const Float32Arb = fc.float();
Empty file.
7 changes: 4 additions & 3 deletions property_tests/tests/float32/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -65,4 +66,4 @@ const Nat8TestArb = fc
};
});

runPropTests(Nat8TestArb);
runPropTests(float32TestArb);

0 comments on commit 42e93ac

Please sign in to comment.