File: api.rs

package info (click to toggle)
rust-cargo-mutants 25.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,452 kB
  • sloc: makefile: 2
file content (26 lines) | stat: -rw-r--r-- 480 bytes parent folder | download | duplicates (2)
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
use cargo_mutants_testdata_integration_tests::double;

#[test]
fn double_zero() {
    assert_eq!(0, double(0));
}

#[test]
fn double_one() {
    assert_eq!(2, double(1));
}

#[test]
fn double_a_number() {
    let n = a_number();
    assert_eq!(double(n), n + n);
}

/// Example of a non-test function within the test module.
///
/// If mutated to return 0 this will make tests falsely pass.
///
/// Functions in test modules should not be mutated.
fn a_number() -> u32 {
    42
}