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
fn main() {
add_one(0);
}
fn add_one (x: u64) -> u64 { x + 1 }
#[cfg(test)]
mod tests {
use super::*;
use laboratory::{describe, expect, LabResult, NullState};
#[test]
fn suite() -> LabResult {
describe("add_one()", |suite| {
suite.it("should return 1", |_| {
expect(add_one(0)).to_equal(1)
})
.it_only("should return 2", |_| {
expect(add_one(1)).to_equal(2)
})
.it("should return 3", |_| {
expect(add_one(2)).to_equal(3)
});
}).state(NullState).run()
}
}