-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1405 from demergent-labs/multiple_property_test_r…
…ounds Multiple property test rounds
- Loading branch information
Showing
11 changed files
with
1,377 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import fc from 'fast-check'; | ||
import { IntArb } from '../primitive/ints/int_arb'; | ||
import { Int8Arb } from '../primitive/ints/int8_arb'; | ||
import { Int16Arb } from '../primitive/ints/int16_arb'; | ||
import { Int32Arb } from '../primitive/ints/int32_arb'; | ||
import { Int64Arb } from '../primitive/ints/int64_arb'; | ||
import { NatArb } from '../primitive/nats/nat_arb'; | ||
import { Nat8Arb } from '../primitive/nats/nat8_arb'; | ||
import { Nat16Arb } from '../primitive/nats/nat16_arb'; | ||
import { Nat32Arb } from '../primitive/nats/nat32_arb'; | ||
import { Nat64Arb } from '../primitive/nats/nat64_arb'; | ||
|
||
// TODO look into making this recursive | ||
// TODO we want to be able to have vecs of vecs | ||
export const VecArb = fc.oneof( | ||
fc.array(IntArb).map((sample) => createVecArbWrapper(sample, 'Vec(int)')), | ||
fc.array(Int8Arb).map((sample) => createVecArbWrapper(sample, 'Vec(int8)')), | ||
fc | ||
.array(Int16Arb) | ||
.map((sample) => createVecArbWrapper(sample, 'Vec(int16)')), | ||
fc | ||
.array(Int32Arb) | ||
.map((sample) => createVecArbWrapper(sample, 'Vec(int32)')), | ||
fc | ||
.array(Int64Arb) | ||
.map((sample) => createVecArbWrapper(sample, 'Vec(int64)')), | ||
fc.array(NatArb).map((sample) => createVecArbWrapper(sample, 'Vec(nat)')), | ||
fc.array(Nat8Arb).map((sample) => createVecArbWrapper(sample, 'Vec(nat8)')), | ||
fc | ||
.array(Nat16Arb) | ||
.map((sample) => createVecArbWrapper(sample, 'Vec(nat16)')), | ||
fc | ||
.array(Nat32Arb) | ||
.map((sample) => createVecArbWrapper(sample, 'Vec(nat32)')), | ||
fc | ||
.array(Nat64Arb) | ||
.map((sample) => createVecArbWrapper(sample, 'Vec(nat64)')) | ||
); | ||
|
||
function createVecArbWrapper(sample: any[], candidType: string) { | ||
return { | ||
vec: sample, | ||
candidType | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"canisters": { | ||
"canister": { | ||
"type": "custom", | ||
"main": "src/index.ts", | ||
"candid": "src/index.did", | ||
"build": "npx azle canister", | ||
"wasm": ".azle/canister/canister.wasm", | ||
"gzip": true, | ||
"declarations": { | ||
"output": "test/dfx_generated/canister", | ||
"node_compatibility": true | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.