summaryrefslogtreecommitdiffstats
path: root/src/doc/book/listings/ch11-writing-automated-tests/output-only-05-single-integration/src/lib.rs
blob: c3961b1f62eddc2ba9f2fc6aaa2eb528ebcf6051 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub fn add_two(a: i32) -> i32 {
    internal_adder(a, 2)
}

fn internal_adder(a: i32, b: i32) -> i32 {
    a + b
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn internal() {
        assert_eq!(4, internal_adder(2, 2));
    }
}