-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathb_property_tests.ak
More file actions
48 lines (38 loc) · 1.12 KB
/
b_property_tests.ak
File metadata and controls
48 lines (38 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//// @hidden
use aiken/cbor
use aiken/collection/list
use aiken/fuzz
use cardano/transaction.{OutputReference}
use test_kit/fuzzy/fuzzer.{transaction_id_fuzzer}
// ## Section 1
/// Fix me in as many ways as possible, at least 2 ways
test prop_1(i via fuzz.int()) {
i / i == i
}
test prop_2(ls via fuzz.list_between(fuzz.constant(0), 5, 10)) {
// DO NOT MODIFY BELOW //
let len = ls |> list.length
len < 5
// DO NOT MODIFY ABOVE //
}
test prop_3(b via fuzz.bool()) {
// DO NOT MODIFY BELOW //
b
// DO NOT MODIFY ABOVE //
}
test prop_4(b8 via fuzz.byte()) fail {
// DO NOT MODIFY BELOW //
b8 % 2 == 0
// DO NOT MODIFY ABOVE //
}
// ## Section 2
// The usage of fuzz.constant at test prop_2 is not really appropriate, albeit working.
// Explain what fuzz.constant is intended for
fn output_reference_fuzzer() -> Fuzzer<OutputReference> {
todo @"Define fn output_reference_fuzzer()"
// Explain the difference between fuzz.and_then and fuzz.map
}
test prop_o_ref(o_ref via output_reference_fuzzer()) {
o_ref |> cbor.diagnostic |> fuzz.label
// Explain the difference between cbor.diagnostic and cbor.serialise
}