whiley_test_file 0.6.2

An API for manipulating test files for the Whiley Programming Language.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
original.name="For_Valid_6"
======
>>> main.whiley
type nat is (int x) where x >= 0

function sum(nat[] items) -> nat:
    int r = 0
    for i in 0..|items| where r >= 0:
        r = r + items[i]
    // Done
    return (nat) r
    
public export method test():
    assume sum([1]) == 1
    assume sum([1,2]) == 3
    assume sum([1,2,3]) == 6
    assume sum([1,2,3,4,5,6]) == 21
---