Skip to content

Commit

Permalink
Merge pull request #17 from aiken-lang/w/set
Browse files Browse the repository at this point in the history
W/set
  • Loading branch information
KtorZ authored Jun 7, 2024
2 parents ec7b4e2 + 3388652 commit 2c529e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 4 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
pre-commit-hooks-nix.url = "github:hercules-ci/pre-commit-hooks.nix/flakeModule";
pre-commit-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
aiken.url = "github:aiken-lang/aiken";
aiken.url = "github:aiken-lang/aiken/v1.0.29-alpha";
treefmt-nix.url = "github:numtide/treefmt-nix";
};

Expand Down
8 changes: 7 additions & 1 deletion lib/aiken/fuzz.test.ak
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use aiken/bytearray
use aiken/fuzz.{
and_then, bool, int, int_between, label, list, list_between, list_with_elem,
map, one_of, set, sublist, such_that,
map, one_of, set, set_between, sublist, such_that,
}
use aiken/list
use aiken/string
Expand Down Expand Up @@ -193,6 +193,12 @@ test prop_set(xs via set(int())) {
list.length(ys) == list.length(xs)
}

test prop_set_between_distribution(n via set_between(int_between(0, 50), 3, 13)) {
let len = n |> list.length
label(len |> string.from_int)
True
}

// This property simply illustrate a case where the `set`
// fuzzer would fail and not loop forever after not being
// able to satisfy the demand (not enough entropy in the
Expand Down

0 comments on commit 2c529e8

Please sign in to comment.