diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 0000000000..37646133df --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,13 @@ +[test-groups] +serial-integration = { max-threads = 1 } + +[[profile.default.overrides]] +filter = 'test(test_run_mutation_test::)' +test-group = 'serial-integration' +slow-timeout = { period = "120s" } +threads-required = "num-cpus" + +[profile.ci] +# Do not cancel the test run on the first failure. +fail-fast = false +retries = 2 diff --git a/.github/workflows/check-and-lint.yml b/.github/workflows/check-and-lint.yml index 285a34e190..24629fb4f0 100644 --- a/.github/workflows/check-and-lint.yml +++ b/.github/workflows/check-and-lint.yml @@ -28,7 +28,7 @@ jobs: runs-on: self-hosted name: Basic ci-check for fmt/clippy/check steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install required deps run: sudo apt-get install libudev-dev libdw-dev lld @@ -47,6 +47,3 @@ jobs: - name: Run clippy run: cargo clippy --all-targets -- -D warnings - - - name: Run tests - run: cargo test diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000000..551dfdb734 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,50 @@ +name: Basic test run + +on: + push: + branches: [ main, develop-m3, develop-m4 ] + paths: + - Cargo.toml + - Cargo.lock + - move-mutator/** + - move-spec-test/** + - move-mutation-test/** + - .github/workflows/run-tests.yml + pull_request: + branches: [ main, develop-m3, develop-m4 ] + paths: + - Cargo.toml + - Cargo.lock + - move-mutator/** + - move-spec-test/** + - move-mutation-test/** + - .github/workflows/run-tests.yml + +env: + CARGO_TERM_COLOR: always + +jobs: + basic-lint-and-check: + runs-on: self-hosted + name: Basic ci-check for tests + steps: + - uses: actions/checkout@v4 + + - name: Install required deps + run: sudo apt-get install libudev-dev libdw-dev lld + + - name: Setup Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: default + toolchain: stable + + - name: Install nextest + uses: taiki-e/install-action@nextest + + - name: Run integration tests in the release mode (due to test duration) + run: cargo nextest run -r --profile ci test_run_mutation_test + + - name: Run normal tests in the debug mode + run: cargo nextest run --profile ci -E 'not test(test_run_mutation_test)' + diff --git a/Cargo.lock b/Cargo.lock index 6532a93ac4..0dd37aeebe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5072,6 +5072,18 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +[[package]] +name = "datatest-stable" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a560b3fd20463b56397bd457aa71243ccfdcffe696050b66e3b1e0ec0457e7f1" +dependencies = [ + "camino", + "fancy-regex", + "libtest-mimic", + "walkdir", +] + [[package]] name = "deadpool" version = "0.9.5" @@ -5664,6 +5676,12 @@ dependencies = [ "version_check", ] +[[package]] +name = "escape8259" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5692dd7b5a1978a5aeb0ce83b7655c58ca8efdcb79d21036ea249da95afec2c6" + [[package]] name = "ethnum" version = "1.5.0" @@ -5693,6 +5711,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fancy-regex" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" +dependencies = [ + "bit-set", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", +] + [[package]] name = "fastrand" version = "2.1.1" @@ -7402,6 +7431,18 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "libtest-mimic" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc0bda45ed5b3a2904262c1bb91e526127aa70e7ef3758aba2ef93cf896b9b58" +dependencies = [ + "clap 4.5.20", + "escape8259", + "termcolor", + "threadpool", +] + [[package]] name = "libz-sys" version = "1.1.20" @@ -8101,6 +8142,7 @@ dependencies = [ "aptos-types", "aptos-vm", "clap 4.5.20", + "datatest-stable", "fs_extra", "log", "move-cli", @@ -8115,6 +8157,7 @@ dependencies = [ "pretty_env_logger", "rayon", "serde", + "stacker", "termcolor", ] @@ -9999,6 +10042,15 @@ version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" +[[package]] +name = "psm" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" +dependencies = [ + "cc", +] + [[package]] name = "publicsuffix" version = "2.2.3" @@ -11491,6 +11543,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "stacker" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "windows-sys 0.59.0", +] + [[package]] name = "static_assertions" version = "1.1.0" diff --git a/Cargo.toml b/Cargo.toml index 49fe341f82..c51fa9ce27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ clap = { version = "4.5", features = ["derive"] } codespan = "0.11" codespan-reporting = "0.11" diffy = "0.3" +datatest-stable = "0.2" either = "1.9" fixed = "= 1.25.1" # required by aptos deps fs_extra = "1.3" @@ -56,6 +57,7 @@ rand = "0.8" rayon = "1.10" serde = { version = "1.0", features = ["derive"] } serde_json = "1" +stacker = "0.1" tabled = "0.16" tempfile = "3.12" termcolor = "1.1" # aptos deps require 1.1 here diff --git a/move-mutation-test/Cargo.toml b/move-mutation-test/Cargo.toml index c2dc12f255..026d41e57f 100644 --- a/move-mutation-test/Cargo.toml +++ b/move-mutation-test/Cargo.toml @@ -37,3 +37,11 @@ pretty_env_logger = { workspace = true } rayon = { workspace = true } serde = { workspace = true } termcolor = { workspace = true } + +[dev-dependencies] +datatest-stable = { workspace = true } +stacker = { workspace = true } + +[[test]] +name = "testsuite" +harness = false diff --git a/move-mutation-test/src/lib.rs b/move-mutation-test/src/lib.rs index 8b03779a5a..7fab0e7dd7 100644 --- a/move-mutation-test/src/lib.rs +++ b/move-mutation-test/src/lib.rs @@ -190,9 +190,6 @@ pub fn run_mutation_test( } } - if let Some(outfile) = &options.output { - test_report.save_to_json_file(outfile)?; - } println!("\nTotal mutants tested: {}", test_report.mutants_tested()); println!("Total mutants killed: {}\n", test_report.mutants_killed()); test_report.print_table(); @@ -200,6 +197,12 @@ pub fn run_mutation_test( benchmarks.total_tool_duration.stop(); benchmarks.display(); + if let Some(outfile) = &options.output { + let out = std::env::current_dir()?.join(outfile); + test_report.save_to_json_file(&out)?; + println!("Report saved to: {}", out.display()); + } + Ok(()) } diff --git a/move-mutation-test/tests/testsuite.rs b/move-mutation-test/tests/testsuite.rs new file mode 100644 index 0000000000..ee889893a3 --- /dev/null +++ b/move-mutation-test/tests/testsuite.rs @@ -0,0 +1,75 @@ +use aptos::common::types::MovePackageDir; +use log::info; +use move_mutation_test::cli::CLIOptions; +use move_mutation_test::cli::TestBuildConfig; +use move_mutation_test::run_mutation_test; +use mutator_common::report::Report; +use std::fs; +use std::path::{Path, PathBuf}; + +const RED_ZONE: usize = 128 * 1024; // 128 KiB +const STACK_SIZE: usize = 32 * RED_ZONE; // 4 MiB + +fn test_run_mutation_test(path: &Path, expected_report: String) -> datatest_stable::Result<()> { + let expected_report = + Report::load_from_str(expected_report).expect("failed to load the report"); + let package_path = path.parent().expect("package path not found"); + + let mut move_pkg = MovePackageDir::new(); + move_pkg.package_dir = Some(PathBuf::from(package_path)); + let test_build_cfg = TestBuildConfig { + move_pkg, + dump_state: false, + filter: None, + ignore_compile_warnings: false, + apply_coverage: true, + gas_limit: 1_000, + }; + + let report_file = PathBuf::from("report.txt"); + let cli_opts = CLIOptions { + output: Some(report_file.clone()), + ..Default::default() + }; + + stacker::maybe_grow(RED_ZONE, STACK_SIZE, || { + run_mutation_test(&cli_opts, &test_build_cfg).expect("running the mutation test failed"); + info!( + "remaining stack size is {}", + stacker::remaining_stack().expect("failed to get the remaining stack size") + ); + }); + + let generated_report = Report::load_from_json_file(&report_file).expect("report not found"); + + // Let's make sure the reports are equal. + let Report { + files: mut expected_entries, + .. + } = expected_report; + let Report { + files: generated_report_files, + .. + } = generated_report; + + // Unfortunately, we cannot compare the files directly since the `package_path` is an absolute + // path and would differ on different machines depending on the package location. + for (file, mutant_stats) in generated_report_files { + let (expected_file, expected_mutant_stats) = expected_entries + .pop_first() + .expect("reports are not the same"); + assert_eq!(file, expected_file); + assert_eq!(mutant_stats, expected_mutant_stats); + } + assert!(expected_entries.is_empty()); + + // Make sure we remove the file since these tests are executed serially - it makes no sense to + // run these tests in parallel since every test spawns the maximum number of threads. + fs::remove_file(report_file).unwrap(); + + Ok(()) +} + +const MOVE_ASSETS: &str = "../move-mutator/tests/move-assets"; + +datatest_stable::harness!(test_run_mutation_test, MOVE_ASSETS, r".*\.exp",); diff --git a/move-mutator/tests/move-assets/breakcontinue/report.txt.exp b/move-mutator/tests/move-assets/breakcontinue/report.txt.exp new file mode 100644 index 0000000000..e359133aaf --- /dev/null +++ b/move-mutator/tests/move-assets/breakcontinue/report.txt.exp @@ -0,0 +1,218 @@ +{ + "files": { + "sources/Break.move": [ + { + "module_func": "Break::smallest_factor", + "tested": 35, + "killed": 34, + "mutants_alive_diffs": [ + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n let i = 2;\n- while (i <= n) {\n+ while (i < n) {\n if (n % i == 0) break;\n i = i + 1\n };\n" + ], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -1,7 +1,7 @@\n module TestAccount::Break {\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n- let i = 2;\n+ let i = 0;\n while (i <= n) {\n if (n % i == 0) break;\n i = i + 1\n", + "--- original\n+++ modified\n@@ -1,7 +1,7 @@\n module TestAccount::Break {\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n- let i = 2;\n+ let i = 18446744073709551615;\n while (i <= n) {\n if (n % i == 0) break;\n i = i + 1\n", + "--- original\n+++ modified\n@@ -1,7 +1,7 @@\n module TestAccount::Break {\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n- let i = 2;\n+ let i = 3;\n while (i <= n) {\n if (n % i == 0) break;\n i = i + 1\n", + "--- original\n+++ modified\n@@ -1,7 +1,7 @@\n module TestAccount::Break {\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n- let i = 2;\n+ let i = 1;\n while (i <= n) {\n if (n % i == 0) break;\n i = i + 1\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n let i = 2;\n- while (i <= n) {\n+ while (true) {\n if (n % i == 0) break;\n i = i + 1\n };\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n let i = 2;\n- while (i <= n) {\n+ while (false) {\n if (n % i == 0) break;\n i = i + 1\n };\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n let i = 2;\n- while (i <= n) {\n+ while (!(i <= n)) {\n if (n % i == 0) break;\n i = i + 1\n };\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n let i = 2;\n- while (i <= n) {\n+ while (i == n) {\n if (n % i == 0) break;\n i = i + 1\n };\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n let i = 2;\n- while (i <= n) {\n+ while (i != n) {\n if (n % i == 0) break;\n i = i + 1\n };\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n let i = 2;\n- while (i <= n) {\n+ while (i > n) {\n if (n % i == 0) break;\n i = i + 1\n };\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun smallest_factor(n: u64): u64 {\n // assuming the input is not 0 or 1\n let i = 2;\n- while (i <= n) {\n+ while (i >= n) {\n if (n % i == 0) break;\n i = i + 1\n };\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (true) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (false) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (!(n % i == 0)) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n % i != 0) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n % i < 0) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n % i > 0) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n % i >= 0) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n + i == 0) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n - i == 0) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n * i == 0) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n / i == 0) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n % i == 18446744073709551615) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n % i == 1) break;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n % i == 0) continue;\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n // assuming the input is not 0 or 1\n let i = 2;\n while (i <= n) {\n- if (n % i == 0) break;\n+ if (n % i == 0) {};\n i = i + 1\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 2;\n while (i <= n) {\n if (n % i == 0) break;\n- i = i + 1\n+ i = i - 1\n };\n\n i\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 2;\n while (i <= n) {\n if (n % i == 0) break;\n- i = i + 1\n+ i = i * 1\n };\n\n i\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 2;\n while (i <= n) {\n if (n % i == 0) break;\n- i = i + 1\n+ i = i / 1\n };\n\n i\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 2;\n while (i <= n) {\n if (n % i == 0) break;\n- i = i + 1\n+ i = i % 1\n };\n\n i\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 2;\n while (i <= n) {\n if (n % i == 0) break;\n- i = i + 1\n+ i = i + 0\n };\n\n i\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 2;\n while (i <= n) {\n if (n % i == 0) break;\n- i = i + 1\n+ i = i + 18446744073709551615\n };\n\n i\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 2;\n while (i <= n) {\n if (n % i == 0) break;\n- i = i + 1\n+ i = i + 2\n };\n\n i\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 2;\n while (i <= n) {\n if (n % i == 0) break;\n- i = i + 1\n+ i = i + 0\n };\n\n i\n" + ] + } + ], + "sources/BreakContinue.move": [ + { + "module_func": "BreakContinue::sum_intermediate", + "tested": 45, + "killed": 45, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::BreakContinue {\n fun sum_intermediate(n: u64): u64 {\n- let sum = 0;\n+ let sum = 18446744073709551615;\n let i = 0;\n loop {\n i = i + 1;\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::BreakContinue {\n fun sum_intermediate(n: u64): u64 {\n- let sum = 0;\n+ let sum = 1;\n let i = 0;\n loop {\n i = i + 1;\n", + "--- original\n+++ modified\n@@ -1,7 +1,7 @@\n module TestAccount::BreakContinue {\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n- let i = 0;\n+ let i = 18446744073709551615;\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n", + "--- original\n+++ modified\n@@ -1,7 +1,7 @@\n module TestAccount::BreakContinue {\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n- let i = 0;\n+ let i = 1;\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n loop {\n- i = i + 1;\n+ i = i - 1;\n if (i % 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n loop {\n- i = i + 1;\n+ i = i * 1;\n if (i % 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n loop {\n- i = i + 1;\n+ i = i / 1;\n if (i % 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n loop {\n- i = i + 1;\n+ i = i % 1;\n if (i % 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n loop {\n- i = i + 1;\n+ i = i + 0;\n if (i % 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n loop {\n- i = i + 1;\n+ i = i + 18446744073709551615;\n if (i % 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n loop {\n- i = i + 1;\n+ i = i + 2;\n if (i % 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n loop {\n- i = i + 1;\n+ i = i + 0;\n if (i % 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (true) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (false) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (!(i % 10 == 0)) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 != 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 < 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 > 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 >= 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i + 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i - 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i * 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i / 10 == 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 0 == 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 18446744073709551615 == 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 11 == 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 9 == 0) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 18446744073709551615) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 1) continue;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 0) break;\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n loop {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 0) {};\n if (i > n) break;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n- if (i > n) break;\n+ if (true) break;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n- if (i > n) break;\n+ if (false) break;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n- if (i > n) break;\n+ if (!(i > n)) break;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n- if (i > n) break;\n+ if (i == n) break;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n- if (i > n) break;\n+ if (i != n) break;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n- if (i > n) break;\n+ if (i < n) break;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n- if (i > n) break;\n+ if (i <= n) break;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n- if (i > n) break;\n+ if (i >= n) break;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n- if (i > n) break;\n+ if (i > n) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n loop {\n i = i + 1;\n if (i % 10 == 0) continue;\n- if (i > n) break;\n+ if (i > n) {};\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -6,7 +6,7 @@\n i = i + 1;\n if (i % 10 == 0) continue;\n if (i > n) break;\n- sum = sum + i\n+ sum = sum - i\n };\n\n sum\n", + "--- original\n+++ modified\n@@ -6,7 +6,7 @@\n i = i + 1;\n if (i % 10 == 0) continue;\n if (i > n) break;\n- sum = sum + i\n+ sum = sum * i\n };\n\n sum\n", + "--- original\n+++ modified\n@@ -6,7 +6,7 @@\n i = i + 1;\n if (i % 10 == 0) continue;\n if (i > n) break;\n- sum = sum + i\n+ sum = sum / i\n };\n\n sum\n", + "--- original\n+++ modified\n@@ -6,7 +6,7 @@\n i = i + 1;\n if (i % 10 == 0) continue;\n if (i > n) break;\n- sum = sum + i\n+ sum = sum % i\n };\n\n sum\n" + ] + } + ], + "sources/Continue.move": [ + { + "module_func": "Continue::sum_intermediate", + "tested": 43, + "killed": 42, + "mutants_alive_diffs": [ + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n let i = 0;\n- while (i < n) {\n+ while (i != n) {\n i = i + 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n" + ], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::Continue {\n fun sum_intermediate(n: u64): u64 {\n- let sum = 0;\n+ let sum = 18446744073709551615;\n let i = 0;\n while (i < n) {\n i = i + 1;\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::Continue {\n fun sum_intermediate(n: u64): u64 {\n- let sum = 0;\n+ let sum = 1;\n let i = 0;\n while (i < n) {\n i = i + 1;\n", + "--- original\n+++ modified\n@@ -1,7 +1,7 @@\n module TestAccount::Continue {\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n- let i = 0;\n+ let i = 18446744073709551615;\n while (i < n) {\n i = i + 1;\n if (i % 10 == 0) continue;\n", + "--- original\n+++ modified\n@@ -1,7 +1,7 @@\n module TestAccount::Continue {\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n- let i = 0;\n+ let i = 1;\n while (i < n) {\n i = i + 1;\n if (i % 10 == 0) continue;\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n let i = 0;\n- while (i < n) {\n+ while (true) {\n i = i + 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n let i = 0;\n- while (i < n) {\n+ while (false) {\n i = i + 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n let i = 0;\n- while (i < n) {\n+ while (!(i < n)) {\n i = i + 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n let i = 0;\n- while (i < n) {\n+ while (i == n) {\n i = i + 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n let i = 0;\n- while (i < n) {\n+ while (i > n) {\n i = i + 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n let i = 0;\n- while (i < n) {\n+ while (i <= n) {\n i = i + 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n", + "--- original\n+++ modified\n@@ -2,7 +2,7 @@\n fun sum_intermediate(n: u64): u64 {\n let sum = 0;\n let i = 0;\n- while (i < n) {\n+ while (i >= n) {\n i = i + 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n while (i < n) {\n- i = i + 1;\n+ i = i - 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n };\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n while (i < n) {\n- i = i + 1;\n+ i = i * 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n };\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n while (i < n) {\n- i = i + 1;\n+ i = i / 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n };\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n while (i < n) {\n- i = i + 1;\n+ i = i % 1;\n if (i % 10 == 0) continue;\n sum = sum + i;\n };\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n while (i < n) {\n- i = i + 1;\n+ i = i + 0;\n if (i % 10 == 0) continue;\n sum = sum + i;\n };\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n while (i < n) {\n- i = i + 1;\n+ i = i + 18446744073709551615;\n if (i % 10 == 0) continue;\n sum = sum + i;\n };\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n while (i < n) {\n- i = i + 1;\n+ i = i + 2;\n if (i % 10 == 0) continue;\n sum = sum + i;\n };\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let sum = 0;\n let i = 0;\n while (i < n) {\n- i = i + 1;\n+ i = i + 0;\n if (i % 10 == 0) continue;\n sum = sum + i;\n };\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (true) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (false) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (!(i % 10 == 0)) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 != 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 < 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 > 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 >= 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i + 10 == 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i - 10 == 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i * 10 == 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i / 10 == 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 0 == 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 18446744073709551615 == 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 11 == 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 9 == 0) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 18446744073709551615) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 1) continue;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 0) break;\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -4,7 +4,7 @@\n let i = 0;\n while (i < n) {\n i = i + 1;\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 0) {};\n sum = sum + i;\n };\n\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n while (i < n) {\n i = i + 1;\n if (i % 10 == 0) continue;\n- sum = sum + i;\n+ sum = sum - i;\n };\n\n sum\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n while (i < n) {\n i = i + 1;\n if (i % 10 == 0) continue;\n- sum = sum + i;\n+ sum = sum * i;\n };\n\n sum\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n while (i < n) {\n i = i + 1;\n if (i % 10 == 0) continue;\n- sum = sum + i;\n+ sum = sum / i;\n };\n\n sum\n", + "--- original\n+++ modified\n@@ -5,7 +5,7 @@\n while (i < n) {\n i = i + 1;\n if (i % 10 == 0) continue;\n- sum = sum + i;\n+ sum = sum % i;\n };\n\n sum\n" + ] + }, + { + "module_func": "Continue::sum_intermediate_in_for", + "tested": 49, + "killed": 48, + "mutants_alive_diffs": [ + "--- original\n+++ modified\n@@ -18,7 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n+ for (i in 1..(n + 1)) {\n if (i % 10 == 0) continue;\n sum = sum + i\n };\n" + ], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -16,7 +16,7 @@\n // It tells us we could improve the code by starting counting from 1,\n // since adding zero to the sum doesn't make much sense.\n fun sum_intermediate_in_for(n: u64): u64 {\n- let sum = 0;\n+ let sum = 18446744073709551615;\n\n for (i in 0..(n + 1)) {\n if (i % 10 == 0) continue;\n", + "--- original\n+++ modified\n@@ -16,7 +16,7 @@\n // It tells us we could improve the code by starting counting from 1,\n // since adding zero to the sum doesn't make much sense.\n fun sum_intermediate_in_for(n: u64): u64 {\n- let sum = 0;\n+ let sum = 1;\n\n for (i in 0..(n + 1)) {\n if (i % 10 == 0) continue;\n", + "--- original\n+++ modified\n@@ -18,7 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n+ for (i in 18446744073709551615..(n + 1)) {\n if (i % 10 == 0) continue;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ true;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ false;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,7 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n+ for (i in 0..(n - 1)) {\n if (i % 10 == 0) continue;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -18,7 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n+ for (i in 0..(n * 1)) {\n if (i % 10 == 0) continue;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -18,7 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n+ for (i in 0..(n / 1)) {\n if (i % 10 == 0) continue;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -18,7 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n+ for (i in 0..(n % 1)) {\n if (i % 10 == 0) continue;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -18,7 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n+ for (i in 0..(n + 0)) {\n if (i % 10 == 0) continue;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -18,7 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n+ for (i in 0..(n + 18446744073709551615)) {\n if (i % 10 == 0) continue;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -18,7 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n+ for (i in 0..(n + 2)) {\n if (i % 10 == 0) continue;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -18,7 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n+ for (i in 0..(n + 0)) {\n if (i % 10 == 0) continue;\n sum = sum + i\n };\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ true;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ false;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ true;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ false;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ true;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ false;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ 0;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ 18446744073709551615;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ 2;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ 0;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ true;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -18,10 +18,7 @@\n fun sum_intermediate_in_for(n: u64): u64 {\n let sum = 0;\n\n- for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n- sum = sum + i\n- };\n+ false;\n\n sum\n }\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (true) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (false) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (!(i % 10 == 0)) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 10 != 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 10 < 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 10 > 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 10 >= 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i + 10 == 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i - 10 == 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i * 10 == 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i / 10 == 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 0 == 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 18446744073709551615 == 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 11 == 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 9 == 0) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 18446744073709551615) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 1) continue;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 0) break;\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n let sum = 0;\n\n for (i in 0..(n + 1)) {\n- if (i % 10 == 0) continue;\n+ if (i % 10 == 0) {};\n sum = sum + i\n };\n\n", + "--- original\n+++ modified\n@@ -20,7 +20,7 @@\n\n for (i in 0..(n + 1)) {\n if (i % 10 == 0) continue;\n- sum = sum + i\n+ sum = sum - i\n };\n\n sum\n", + "--- original\n+++ modified\n@@ -20,7 +20,7 @@\n\n for (i in 0..(n + 1)) {\n if (i % 10 == 0) continue;\n- sum = sum + i\n+ sum = sum * i\n };\n\n sum\n", + "--- original\n+++ modified\n@@ -20,7 +20,7 @@\n\n for (i in 0..(n + 1)) {\n if (i % 10 == 0) continue;\n- sum = sum + i\n+ sum = sum / i\n };\n\n sum\n", + "--- original\n+++ modified\n@@ -20,7 +20,7 @@\n\n for (i in 0..(n + 1)) {\n if (i % 10 == 0) continue;\n- sum = sum + i\n+ sum = sum % i\n };\n\n sum\n" + ] + } + ] + }, + "package_dir": "move-spec-testing/move-mutator/tests/move-assets/breakcontinue" +} diff --git a/move-mutator/tests/move-assets/simple/report.txt.exp b/move-mutator/tests/move-assets/simple/report.txt.exp new file mode 100644 index 0000000000..6af92cb7b0 --- /dev/null +++ b/move-mutator/tests/move-assets/simple/report.txt.exp @@ -0,0 +1,547 @@ +{ + "files": { + "sources/BinaryReplacement.move": [ + { + "module_func": "BinaryReplacement::is_x_eq_to_zero", + "tested": 11, + "killed": 11, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::BinaryReplacement {\n fun is_x_eq_to_zero(x: u64): bool {\n- if (x == 0)\n+ if (true)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::BinaryReplacement {\n fun is_x_eq_to_zero(x: u64): bool {\n- if (x == 0)\n+ if (false)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::BinaryReplacement {\n fun is_x_eq_to_zero(x: u64): bool {\n- if (x == 0)\n+ if (!(x == 0))\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::BinaryReplacement {\n fun is_x_eq_to_zero(x: u64): bool {\n- if (x == 0)\n+ if (x != 0)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::BinaryReplacement {\n fun is_x_eq_to_zero(x: u64): bool {\n- if (x == 0)\n+ if (x < 0)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::BinaryReplacement {\n fun is_x_eq_to_zero(x: u64): bool {\n- if (x == 0)\n+ if (x > 0)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::BinaryReplacement {\n fun is_x_eq_to_zero(x: u64): bool {\n- if (x == 0)\n+ if (x >= 0)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::BinaryReplacement {\n fun is_x_eq_to_zero(x: u64): bool {\n- if (x == 0)\n+ if (x == 18446744073709551615)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::BinaryReplacement {\n fun is_x_eq_to_zero(x: u64): bool {\n- if (x == 0)\n+ if (x == 1)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -1,7 +1,7 @@\n module TestAccount::BinaryReplacement {\n fun is_x_eq_to_zero(x: u64): bool {\n if (x == 0)\n- return true;\n+ return false;\n\n false\n }\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n if (x == 0)\n return true;\n\n- false\n+ true\n }\n\n fun is_zero_eq_to_x(x: u64): bool {\n" + ] + }, + { + "module_func": "BinaryReplacement::is_x_gt_zero", + "tested": 6, + "killed": 5, + "mutants_alive_diffs": [ + "--- original\n+++ modified\n@@ -63,7 +63,7 @@\n }\n\n fun is_x_gt_zero(x: u64): bool {\n- x > 0\n+ x > 1\n }\n\n #[test]\n" + ], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -63,7 +63,7 @@\n }\n\n fun is_x_gt_zero(x: u64): bool {\n- x > 0\n+ x == 0\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -63,7 +63,7 @@\n }\n\n fun is_x_gt_zero(x: u64): bool {\n- x > 0\n+ x < 0\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -63,7 +63,7 @@\n }\n\n fun is_x_gt_zero(x: u64): bool {\n- x > 0\n+ x <= 0\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -63,7 +63,7 @@\n }\n\n fun is_x_gt_zero(x: u64): bool {\n- x > 0\n+ x >= 0\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -63,7 +63,7 @@\n }\n\n fun is_x_gt_zero(x: u64): bool {\n- x > 0\n+ x > 18446744073709551615\n }\n\n #[test]\n" + ] + }, + { + "module_func": "BinaryReplacement::is_x_neq_to_zero", + "tested": 6, + "killed": 6, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -43,7 +43,7 @@\n }\n\n fun is_x_neq_to_zero(x: u64): bool {\n- x != 0\n+ x == 0\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -43,7 +43,7 @@\n }\n\n fun is_x_neq_to_zero(x: u64): bool {\n- x != 0\n+ x < 0\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -43,7 +43,7 @@\n }\n\n fun is_x_neq_to_zero(x: u64): bool {\n- x != 0\n+ x <= 0\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -43,7 +43,7 @@\n }\n\n fun is_x_neq_to_zero(x: u64): bool {\n- x != 0\n+ x >= 0\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -43,7 +43,7 @@\n }\n\n fun is_x_neq_to_zero(x: u64): bool {\n- x != 0\n+ x != 18446744073709551615\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -43,7 +43,7 @@\n }\n\n fun is_x_neq_to_zero(x: u64): bool {\n- x != 0\n+ x != 1\n }\n\n #[test]\n" + ] + }, + { + "module_func": "BinaryReplacement::is_zero_eq_to_x", + "tested": 11, + "killed": 11, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -7,7 +7,7 @@\n }\n\n fun is_zero_eq_to_x(x: u64): bool {\n- if (0 == x)\n+ if (true)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -7,7 +7,7 @@\n }\n\n fun is_zero_eq_to_x(x: u64): bool {\n- if (0 == x)\n+ if (false)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -7,7 +7,7 @@\n }\n\n fun is_zero_eq_to_x(x: u64): bool {\n- if (0 == x)\n+ if (!(0 == x))\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -7,7 +7,7 @@\n }\n\n fun is_zero_eq_to_x(x: u64): bool {\n- if (0 == x)\n+ if (0 != x)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -7,7 +7,7 @@\n }\n\n fun is_zero_eq_to_x(x: u64): bool {\n- if (0 == x)\n+ if (0 < x)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -7,7 +7,7 @@\n }\n\n fun is_zero_eq_to_x(x: u64): bool {\n- if (0 == x)\n+ if (0 > x)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -7,7 +7,7 @@\n }\n\n fun is_zero_eq_to_x(x: u64): bool {\n- if (0 == x)\n+ if (0 <= x)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -7,7 +7,7 @@\n }\n\n fun is_zero_eq_to_x(x: u64): bool {\n- if (0 == x)\n+ if (18446744073709551615 == x)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -7,7 +7,7 @@\n }\n\n fun is_zero_eq_to_x(x: u64): bool {\n- if (0 == x)\n+ if (1 == x)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -8,7 +8,7 @@\n\n fun is_zero_eq_to_x(x: u64): bool {\n if (0 == x)\n- return true;\n+ return false;\n\n false\n }\n", + "--- original\n+++ modified\n@@ -10,7 +10,7 @@\n if (0 == x)\n return true;\n\n- false\n+ true\n }\n\n #[test]\n" + ] + }, + { + "module_func": "BinaryReplacement::is_zero_lt_x", + "tested": 6, + "killed": 5, + "mutants_alive_diffs": [ + "--- original\n+++ modified\n@@ -73,7 +73,7 @@\n }\n\n fun is_zero_lt_x(x: u64): bool {\n- 0 < x\n+ 1 < x\n }\n\n #[test]\n" + ], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -73,7 +73,7 @@\n }\n\n fun is_zero_lt_x(x: u64): bool {\n- 0 < x\n+ 0 == x\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -73,7 +73,7 @@\n }\n\n fun is_zero_lt_x(x: u64): bool {\n- 0 < x\n+ 0 > x\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -73,7 +73,7 @@\n }\n\n fun is_zero_lt_x(x: u64): bool {\n- 0 < x\n+ 0 <= x\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -73,7 +73,7 @@\n }\n\n fun is_zero_lt_x(x: u64): bool {\n- 0 < x\n+ 0 >= x\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -73,7 +73,7 @@\n }\n\n fun is_zero_lt_x(x: u64): bool {\n- 0 < x\n+ 18446744073709551615 < x\n }\n\n #[test]\n" + ] + }, + { + "module_func": "BinaryReplacement::is_zero_neq_to_x", + "tested": 6, + "killed": 6, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -53,7 +53,7 @@\n }\n\n fun is_zero_neq_to_x(x: u64): bool {\n- 0 != x\n+ 0 == x\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -53,7 +53,7 @@\n }\n\n fun is_zero_neq_to_x(x: u64): bool {\n- 0 != x\n+ 0 > x\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -53,7 +53,7 @@\n }\n\n fun is_zero_neq_to_x(x: u64): bool {\n- 0 != x\n+ 0 <= x\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -53,7 +53,7 @@\n }\n\n fun is_zero_neq_to_x(x: u64): bool {\n- 0 != x\n+ 0 >= x\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -53,7 +53,7 @@\n }\n\n fun is_zero_neq_to_x(x: u64): bool {\n- 0 != x\n+ 18446744073709551615 != x\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -53,7 +53,7 @@\n }\n\n fun is_zero_neq_to_x(x: u64): bool {\n- 0 != x\n+ 1 != x\n }\n\n #[test]\n" + ] + }, + { + "module_func": "BinaryReplacement::is_zero_silly_code", + "tested": 20, + "killed": 14, + "mutants_alive_diffs": [ + "--- original\n+++ modified\n@@ -26,7 +26,7 @@\n // and that would be a clear indication of silly code that has\n // one identical reduntant check.\n fun is_zero_silly_code(x: u64): bool {\n- if (0 == x)\n+ if (false)\n return true;\n\n // Another check which does the same is silly:\n", + "--- original\n+++ modified\n@@ -26,7 +26,7 @@\n // and that would be a clear indication of silly code that has\n // one identical reduntant check.\n fun is_zero_silly_code(x: u64): bool {\n- if (0 == x)\n+ if (0 > x)\n return true;\n\n // Another check which does the same is silly:\n", + "--- original\n+++ modified\n@@ -26,7 +26,7 @@\n // and that would be a clear indication of silly code that has\n // one identical reduntant check.\n fun is_zero_silly_code(x: u64): bool {\n- if (0 == x)\n+ if (18446744073709551615 == x)\n return true;\n\n // Another check which does the same is silly:\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n return true;\n\n // Another check which does the same is silly:\n- if (x == 0)\n+ if (false)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n return true;\n\n // Another check which does the same is silly:\n- if (x == 0)\n+ if (x < 0)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n return true;\n\n // Another check which does the same is silly:\n- if (x == 0)\n+ if (x == 18446744073709551615)\n return true;\n\n false\n" + ], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -26,7 +26,7 @@\n // and that would be a clear indication of silly code that has\n // one identical reduntant check.\n fun is_zero_silly_code(x: u64): bool {\n- if (0 == x)\n+ if (true)\n return true;\n\n // Another check which does the same is silly:\n", + "--- original\n+++ modified\n@@ -26,7 +26,7 @@\n // and that would be a clear indication of silly code that has\n // one identical reduntant check.\n fun is_zero_silly_code(x: u64): bool {\n- if (0 == x)\n+ if (!(0 == x))\n return true;\n\n // Another check which does the same is silly:\n", + "--- original\n+++ modified\n@@ -26,7 +26,7 @@\n // and that would be a clear indication of silly code that has\n // one identical reduntant check.\n fun is_zero_silly_code(x: u64): bool {\n- if (0 == x)\n+ if (0 != x)\n return true;\n\n // Another check which does the same is silly:\n", + "--- original\n+++ modified\n@@ -26,7 +26,7 @@\n // and that would be a clear indication of silly code that has\n // one identical reduntant check.\n fun is_zero_silly_code(x: u64): bool {\n- if (0 == x)\n+ if (0 < x)\n return true;\n\n // Another check which does the same is silly:\n", + "--- original\n+++ modified\n@@ -26,7 +26,7 @@\n // and that would be a clear indication of silly code that has\n // one identical reduntant check.\n fun is_zero_silly_code(x: u64): bool {\n- if (0 == x)\n+ if (0 <= x)\n return true;\n\n // Another check which does the same is silly:\n", + "--- original\n+++ modified\n@@ -26,7 +26,7 @@\n // and that would be a clear indication of silly code that has\n // one identical reduntant check.\n fun is_zero_silly_code(x: u64): bool {\n- if (0 == x)\n+ if (1 == x)\n return true;\n\n // Another check which does the same is silly:\n", + "--- original\n+++ modified\n@@ -27,7 +27,7 @@\n // one identical reduntant check.\n fun is_zero_silly_code(x: u64): bool {\n if (0 == x)\n- return true;\n+ return false;\n\n // Another check which does the same is silly:\n if (x == 0)\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n return true;\n\n // Another check which does the same is silly:\n- if (x == 0)\n+ if (true)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n return true;\n\n // Another check which does the same is silly:\n- if (x == 0)\n+ if (!(x == 0))\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n return true;\n\n // Another check which does the same is silly:\n- if (x == 0)\n+ if (x != 0)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n return true;\n\n // Another check which does the same is silly:\n- if (x == 0)\n+ if (x > 0)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n return true;\n\n // Another check which does the same is silly:\n- if (x == 0)\n+ if (x >= 0)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n return true;\n\n // Another check which does the same is silly:\n- if (x == 0)\n+ if (x == 1)\n return true;\n\n false\n", + "--- original\n+++ modified\n@@ -33,7 +33,7 @@\n if (x == 0)\n return true;\n\n- false\n+ true\n }\n\n #[test]\n" + ] + } + ], + "sources/Operators.move": [ + { + "module_func": "Operators::and", + "tested": 2, + "killed": 2, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -108,7 +108,7 @@\n }\n\n fun and(x: u64, y: u64): u64 {\n- x & y\n+ x | y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -108,7 +108,7 @@\n }\n\n fun and(x: u64, y: u64): u64 {\n- x & y\n+ x ^ y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::div", + "tested": 4, + "killed": 4, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -83,7 +83,7 @@\n }\n\n fun div(x: u64, y: u64): u64 {\n- x / y\n+ x + y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -83,7 +83,7 @@\n }\n\n fun div(x: u64, y: u64): u64 {\n- x / y\n+ x - y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -83,7 +83,7 @@\n }\n\n fun div(x: u64, y: u64): u64 {\n- x / y\n+ x * y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -83,7 +83,7 @@\n }\n\n fun div(x: u64, y: u64): u64 {\n- x / y\n+ x % y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::eq", + "tested": 5, + "killed": 5, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -241,7 +241,7 @@\n }\n\n fun eq(x: u8, y: u8): bool {\n- x == y\n+ x != y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -241,7 +241,7 @@\n }\n\n fun eq(x: u8, y: u8): bool {\n- x == y\n+ x < y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -241,7 +241,7 @@\n }\n\n fun eq(x: u8, y: u8): bool {\n- x == y\n+ x > y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -241,7 +241,7 @@\n }\n\n fun eq(x: u8, y: u8): bool {\n- x == y\n+ x <= y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -241,7 +241,7 @@\n }\n\n fun eq(x: u8, y: u8): bool {\n- x == y\n+ x >= y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::gt", + "tested": 5, + "killed": 5, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -305,7 +305,7 @@\n }\n\n fun gt(x: u64, y: u64): bool {\n- x > y\n+ x == y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -305,7 +305,7 @@\n }\n\n fun gt(x: u64, y: u64): bool {\n- x > y\n+ x != y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -305,7 +305,7 @@\n }\n\n fun gt(x: u64, y: u64): bool {\n- x > y\n+ x < y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -305,7 +305,7 @@\n }\n\n fun gt(x: u64, y: u64): bool {\n- x > y\n+ x <= y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -305,7 +305,7 @@\n }\n\n fun gt(x: u64, y: u64): bool {\n- x > y\n+ x >= y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::gte", + "tested": 5, + "killed": 5, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -321,7 +321,7 @@\n }\n\n fun gte(x: u64, y: u64): bool {\n- x >= y\n+ x == y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -321,7 +321,7 @@\n }\n\n fun gte(x: u64, y: u64): bool {\n- x >= y\n+ x != y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -321,7 +321,7 @@\n }\n\n fun gte(x: u64, y: u64): bool {\n- x >= y\n+ x < y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -321,7 +321,7 @@\n }\n\n fun gte(x: u64, y: u64): bool {\n- x >= y\n+ x > y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -321,7 +321,7 @@\n }\n\n fun gte(x: u64, y: u64): bool {\n- x >= y\n+ x <= y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::logical_and", + "tested": 1, + "killed": 1, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -219,7 +219,7 @@\n }\n\n fun logical_and(x: bool, y: bool): bool {\n- x && y\n+ x || y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::logical_or", + "tested": 1, + "killed": 1, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -207,7 +207,7 @@\n }\n\n fun logical_or(x: bool, y: bool): bool {\n- x || y\n+ x && y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::lsh", + "tested": 1, + "killed": 1, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -163,7 +163,7 @@\n }\n\n fun lsh(x: u64, y: u8): u64 {\n- x << y\n+ x >> y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::lt", + "tested": 5, + "killed": 5, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -273,7 +273,7 @@\n }\n\n fun lt(x: u64, y: u64): bool {\n- x < y\n+ x == y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -273,7 +273,7 @@\n }\n\n fun lt(x: u64, y: u64): bool {\n- x < y\n+ x != y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -273,7 +273,7 @@\n }\n\n fun lt(x: u64, y: u64): bool {\n- x < y\n+ x > y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -273,7 +273,7 @@\n }\n\n fun lt(x: u64, y: u64): bool {\n- x < y\n+ x <= y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -273,7 +273,7 @@\n }\n\n fun lt(x: u64, y: u64): bool {\n- x < y\n+ x >= y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::lte", + "tested": 5, + "killed": 5, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -289,7 +289,7 @@\n }\n\n fun lte(x: u64, y: u64): bool {\n- x <= y\n+ x == y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -289,7 +289,7 @@\n }\n\n fun lte(x: u64, y: u64): bool {\n- x <= y\n+ x != y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -289,7 +289,7 @@\n }\n\n fun lte(x: u64, y: u64): bool {\n- x <= y\n+ x < y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -289,7 +289,7 @@\n }\n\n fun lte(x: u64, y: u64): bool {\n- x <= y\n+ x > y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -289,7 +289,7 @@\n }\n\n fun lte(x: u64, y: u64): bool {\n- x <= y\n+ x >= y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::mod", + "tested": 4, + "killed": 4, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -54,7 +54,7 @@\n }\n\n fun mod(x: u64, y: u64): u64 {\n- x % y\n+ x + y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -54,7 +54,7 @@\n }\n\n fun mod(x: u64, y: u64): u64 {\n- x % y\n+ x - y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -54,7 +54,7 @@\n }\n\n fun mod(x: u64, y: u64): u64 {\n- x % y\n+ x * y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -54,7 +54,7 @@\n }\n\n fun mod(x: u64, y: u64): u64 {\n- x % y\n+ x / y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::mul", + "tested": 4, + "killed": 4, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n }\n\n fun mul(x: u64, y: u64): u64 {\n- x * y\n+ x + y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n }\n\n fun mul(x: u64, y: u64): u64 {\n- x * y\n+ x - y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n }\n\n fun mul(x: u64, y: u64): u64 {\n- x * y\n+ x / y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -30,7 +30,7 @@\n }\n\n fun mul(x: u64, y: u64): u64 {\n- x * y\n+ x % y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::neq", + "tested": 5, + "killed": 5, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -257,7 +257,7 @@\n }\n\n fun neq(x: u8, y: u8): bool {\n- x != y\n+ x == y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -257,7 +257,7 @@\n }\n\n fun neq(x: u8, y: u8): bool {\n- x != y\n+ x < y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -257,7 +257,7 @@\n }\n\n fun neq(x: u8, y: u8): bool {\n- x != y\n+ x > y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -257,7 +257,7 @@\n }\n\n fun neq(x: u8, y: u8): bool {\n- x != y\n+ x <= y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -257,7 +257,7 @@\n }\n\n fun neq(x: u8, y: u8): bool {\n- x != y\n+ x >= y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::or", + "tested": 2, + "killed": 2, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -128,7 +128,7 @@\n }\n\n fun or(x: u64, y: u64): u64 {\n- x | y\n+ x & y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -128,7 +128,7 @@\n }\n\n fun or(x: u64, y: u64): u64 {\n- x | y\n+ x ^ y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::rsh", + "tested": 1, + "killed": 1, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -185,7 +185,7 @@\n }\n\n fun rsh(x: u64, y: u8): u64 {\n- x >> y\n+ x << y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::sub", + "tested": 4, + "killed": 4, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -13,7 +13,7 @@\n }\n\n fun sub(x: u64, y: u64): u64 {\n- x - y\n+ x + y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -13,7 +13,7 @@\n }\n\n fun sub(x: u64, y: u64): u64 {\n- x - y\n+ x * y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -13,7 +13,7 @@\n }\n\n fun sub(x: u64, y: u64): u64 {\n- x - y\n+ x / y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -13,7 +13,7 @@\n }\n\n fun sub(x: u64, y: u64): u64 {\n- x - y\n+ x % y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::sum", + "tested": 4, + "killed": 4, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::Operators {\n fun sum(x: u64, y: u64): u64 {\n- x + y\n+ x - y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::Operators {\n fun sum(x: u64, y: u64): u64 {\n- x + y\n+ x * y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::Operators {\n fun sum(x: u64, y: u64): u64 {\n- x + y\n+ x / y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::Operators {\n fun sum(x: u64, y: u64): u64 {\n- x + y\n+ x % y\n }\n\n #[test]\n" + ] + }, + { + "module_func": "Operators::xor", + "tested": 2, + "killed": 2, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -149,7 +149,7 @@\n }\n\n fun xor(x: u64, y: u64): u64 {\n- x ^ y\n+ x | y\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -149,7 +149,7 @@\n }\n\n fun xor(x: u64, y: u64): u64 {\n- x ^ y\n+ x & y\n }\n\n #[test]\n" + ] + } + ], + "sources/StillSimple.move": [ + { + "module_func": "StillSimple::sample1", + "tested": 18, + "killed": 15, + "mutants_alive_diffs": [ + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::StillSimple {\n fun sample1(x: u128, y: u128) {\n- let _sum_r = x + y;\n+ let _sum_r = x * y;\n\n // Impossible condition here:\n if ((x + y) < 0) abort 1;\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if (false) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if ((x * y) < 0) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n" + ], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::StillSimple {\n fun sample1(x: u128, y: u128) {\n- let _sum_r = x + y;\n+ let _sum_r = x - y;\n\n // Impossible condition here:\n if ((x + y) < 0) abort 1;\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::StillSimple {\n fun sample1(x: u128, y: u128) {\n- let _sum_r = x + y;\n+ let _sum_r = x / y;\n\n // Impossible condition here:\n if ((x + y) < 0) abort 1;\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::StillSimple {\n fun sample1(x: u128, y: u128) {\n- let _sum_r = x + y;\n+ let _sum_r = x % y;\n\n // Impossible condition here:\n if ((x + y) < 0) abort 1;\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if (true) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if (!((x + y) < 0)) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if ((x + y) == 0) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if ((x + y) != 0) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if ((x + y) > 0) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if ((x + y) <= 0) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if ((x + y) >= 0) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if ((x - y) < 0) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if ((x / y) < 0) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if ((x % y) < 0) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if ((x + y) < 340282366920938463463374607431768211455) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n", + "--- original\n+++ modified\n@@ -3,7 +3,7 @@\n let _sum_r = x + y;\n\n // Impossible condition here:\n- if ((x + y) < 0) abort 1;\n+ if ((x + y) < 1) abort 1;\n }\n\n // This test will generate mutants that will survive and indicate the impossible condition in the code.\n" + ] + }, + { + "module_func": "StillSimple::sample2", + "tested": 11, + "killed": 10, + "mutants_alive_diffs": [ + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n }\n\n fun sample2(a1: u64, a2: u64): bool {\n- let lamb = apply(0, |v| v != a1 + a2);\n+ let lamb = apply(0, |v| v < a1 + a2);\n lamb\n }\n\n" + ], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n }\n\n fun sample2(a1: u64, a2: u64): bool {\n- let lamb = apply(0, |v| v != a1 + a2);\n+ let lamb = apply(18446744073709551615, |v| v != a1 + a2);\n lamb\n }\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n }\n\n fun sample2(a1: u64, a2: u64): bool {\n- let lamb = apply(0, |v| v != a1 + a2);\n+ let lamb = apply(1, |v| v != a1 + a2);\n lamb\n }\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n }\n\n fun sample2(a1: u64, a2: u64): bool {\n- let lamb = apply(0, |v| v != a1 + a2);\n+ let lamb = apply(0, |v| v == a1 + a2);\n lamb\n }\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n }\n\n fun sample2(a1: u64, a2: u64): bool {\n- let lamb = apply(0, |v| v != a1 + a2);\n+ let lamb = apply(0, |v| v > a1 + a2);\n lamb\n }\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n }\n\n fun sample2(a1: u64, a2: u64): bool {\n- let lamb = apply(0, |v| v != a1 + a2);\n+ let lamb = apply(0, |v| v <= a1 + a2);\n lamb\n }\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n }\n\n fun sample2(a1: u64, a2: u64): bool {\n- let lamb = apply(0, |v| v != a1 + a2);\n+ let lamb = apply(0, |v| v >= a1 + a2);\n lamb\n }\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n }\n\n fun sample2(a1: u64, a2: u64): bool {\n- let lamb = apply(0, |v| v != a1 + a2);\n+ let lamb = apply(0, |v| v != a1 - a2);\n lamb\n }\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n }\n\n fun sample2(a1: u64, a2: u64): bool {\n- let lamb = apply(0, |v| v != a1 + a2);\n+ let lamb = apply(0, |v| v != a1 * a2);\n lamb\n }\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n }\n\n fun sample2(a1: u64, a2: u64): bool {\n- let lamb = apply(0, |v| v != a1 + a2);\n+ let lamb = apply(0, |v| v != a1 / a2);\n lamb\n }\n\n", + "--- original\n+++ modified\n@@ -19,7 +19,7 @@\n }\n\n fun sample2(a1: u64, a2: u64): bool {\n- let lamb = apply(0, |v| v != a1 + a2);\n+ let lamb = apply(0, |v| v != a1 % a2);\n lamb\n }\n\n" + ] + }, + { + "module_func": "StillSimple::sample3", + "tested": 26, + "killed": 25, + "mutants_alive_diffs": [ + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ sample3(n, e - 1) * n\n }\n }\n\n" + ], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -36,7 +36,7 @@\n }\n\n public fun sample3(n: u64, e: u64): u64 {\n- if (e == 0) {\n+ if (true) {\n 1\n } else {\n n * sample3(n, e - 1)\n", + "--- original\n+++ modified\n@@ -36,7 +36,7 @@\n }\n\n public fun sample3(n: u64, e: u64): u64 {\n- if (e == 0) {\n+ if (false) {\n 1\n } else {\n n * sample3(n, e - 1)\n", + "--- original\n+++ modified\n@@ -36,7 +36,7 @@\n }\n\n public fun sample3(n: u64, e: u64): u64 {\n- if (e == 0) {\n+ if (!(e == 0)) {\n 1\n } else {\n n * sample3(n, e - 1)\n", + "--- original\n+++ modified\n@@ -36,7 +36,7 @@\n }\n\n public fun sample3(n: u64, e: u64): u64 {\n- if (e == 0) {\n+ if (e != 0) {\n 1\n } else {\n n * sample3(n, e - 1)\n", + "--- original\n+++ modified\n@@ -36,7 +36,7 @@\n }\n\n public fun sample3(n: u64, e: u64): u64 {\n- if (e == 0) {\n+ if (e < 0) {\n 1\n } else {\n n * sample3(n, e - 1)\n", + "--- original\n+++ modified\n@@ -36,7 +36,7 @@\n }\n\n public fun sample3(n: u64, e: u64): u64 {\n- if (e == 0) {\n+ if (e > 0) {\n 1\n } else {\n n * sample3(n, e - 1)\n", + "--- original\n+++ modified\n@@ -36,7 +36,7 @@\n }\n\n public fun sample3(n: u64, e: u64): u64 {\n- if (e == 0) {\n+ if (e >= 0) {\n 1\n } else {\n n * sample3(n, e - 1)\n", + "--- original\n+++ modified\n@@ -36,7 +36,7 @@\n }\n\n public fun sample3(n: u64, e: u64): u64 {\n- if (e == 0) {\n+ if (e == 18446744073709551615) {\n 1\n } else {\n n * sample3(n, e - 1)\n", + "--- original\n+++ modified\n@@ -36,7 +36,7 @@\n }\n\n public fun sample3(n: u64, e: u64): u64 {\n- if (e == 0) {\n+ if (e == 1) {\n 1\n } else {\n n * sample3(n, e - 1)\n", + "--- original\n+++ modified\n@@ -37,7 +37,7 @@\n\n public fun sample3(n: u64, e: u64): u64 {\n if (e == 0) {\n- 1\n+ 0\n } else {\n n * sample3(n, e - 1)\n }\n", + "--- original\n+++ modified\n@@ -37,7 +37,7 @@\n\n public fun sample3(n: u64, e: u64): u64 {\n if (e == 0) {\n- 1\n+ 18446744073709551615\n } else {\n n * sample3(n, e - 1)\n }\n", + "--- original\n+++ modified\n@@ -37,7 +37,7 @@\n\n public fun sample3(n: u64, e: u64): u64 {\n if (e == 0) {\n- 1\n+ 2\n } else {\n n * sample3(n, e - 1)\n }\n", + "--- original\n+++ modified\n@@ -37,7 +37,7 @@\n\n public fun sample3(n: u64, e: u64): u64 {\n if (e == 0) {\n- 1\n+ 0\n } else {\n n * sample3(n, e - 1)\n }\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n + sample3(n, e - 1)\n }\n }\n\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n - sample3(n, e - 1)\n }\n }\n\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n / sample3(n, e - 1)\n }\n }\n\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n % sample3(n, e - 1)\n }\n }\n\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n * sample3(n, e + 1)\n }\n }\n\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n * sample3(n, e * 1)\n }\n }\n\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n * sample3(n, e / 1)\n }\n }\n\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n * sample3(n, e % 1)\n }\n }\n\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n * sample3(n, e - 0)\n }\n }\n\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n * sample3(n, e - 18446744073709551615)\n }\n }\n\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n * sample3(n, e - 2)\n }\n }\n\n", + "--- original\n+++ modified\n@@ -39,7 +39,7 @@\n if (e == 0) {\n 1\n } else {\n- n * sample3(n, e - 1)\n+ n * sample3(n, e - 0)\n }\n }\n\n" + ] + }, + { + "module_func": "StillSimple::sample4", + "tested": 38, + "killed": 28, + "mutants_alive_diffs": [ + "--- original\n+++ modified\n@@ -67,7 +67,7 @@\n\n fun sample4(x: u128, y: u128) {\n loop {\n- if (x > y) {\n+ if (false) {\n y = y + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -68,7 +68,7 @@\n fun sample4(x: u128, y: u128) {\n loop {\n if (x > y) {\n- y = y + 1;\n+ y = y + 2;\n continue\n };\n if (y > x) {\n", + "--- original\n+++ modified\n@@ -69,7 +69,7 @@\n loop {\n if (x > y) {\n y = y + 1;\n- continue\n+ break\n };\n if (y > x) {\n x = x + 1;\n", + "--- original\n+++ modified\n@@ -69,7 +69,7 @@\n loop {\n if (x > y) {\n y = y + 1;\n- continue\n+ {}\n };\n if (y > x) {\n x = x + 1;\n", + "--- original\n+++ modified\n@@ -71,7 +71,7 @@\n y = y + 1;\n continue\n };\n- if (y > x) {\n+ if (false) {\n x = x + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -71,7 +71,7 @@\n y = y + 1;\n continue\n };\n- if (y > x) {\n+ if (y != x) {\n x = x + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -71,7 +71,7 @@\n y = y + 1;\n continue\n };\n- if (y > x) {\n+ if (y < x) {\n x = x + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -72,7 +72,7 @@\n continue\n };\n if (y > x) {\n- x = x + 1;\n+ x = x + 2;\n continue\n };\n break\n", + "--- original\n+++ modified\n@@ -73,7 +73,7 @@\n };\n if (y > x) {\n x = x + 1;\n- continue\n+ break\n };\n break\n };\n", + "--- original\n+++ modified\n@@ -73,7 +73,7 @@\n };\n if (y > x) {\n x = x + 1;\n- continue\n+ {}\n };\n break\n };\n" + ], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -67,7 +67,7 @@\n\n fun sample4(x: u128, y: u128) {\n loop {\n- if (x > y) {\n+ if (true) {\n y = y + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -67,7 +67,7 @@\n\n fun sample4(x: u128, y: u128) {\n loop {\n- if (x > y) {\n+ if (!(x > y)) {\n y = y + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -67,7 +67,7 @@\n\n fun sample4(x: u128, y: u128) {\n loop {\n- if (x > y) {\n+ if (x == y) {\n y = y + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -67,7 +67,7 @@\n\n fun sample4(x: u128, y: u128) {\n loop {\n- if (x > y) {\n+ if (x != y) {\n y = y + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -67,7 +67,7 @@\n\n fun sample4(x: u128, y: u128) {\n loop {\n- if (x > y) {\n+ if (x < y) {\n y = y + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -67,7 +67,7 @@\n\n fun sample4(x: u128, y: u128) {\n loop {\n- if (x > y) {\n+ if (x <= y) {\n y = y + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -67,7 +67,7 @@\n\n fun sample4(x: u128, y: u128) {\n loop {\n- if (x > y) {\n+ if (x >= y) {\n y = y + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -68,7 +68,7 @@\n fun sample4(x: u128, y: u128) {\n loop {\n if (x > y) {\n- y = y + 1;\n+ y = y - 1;\n continue\n };\n if (y > x) {\n", + "--- original\n+++ modified\n@@ -68,7 +68,7 @@\n fun sample4(x: u128, y: u128) {\n loop {\n if (x > y) {\n- y = y + 1;\n+ y = y * 1;\n continue\n };\n if (y > x) {\n", + "--- original\n+++ modified\n@@ -68,7 +68,7 @@\n fun sample4(x: u128, y: u128) {\n loop {\n if (x > y) {\n- y = y + 1;\n+ y = y / 1;\n continue\n };\n if (y > x) {\n", + "--- original\n+++ modified\n@@ -68,7 +68,7 @@\n fun sample4(x: u128, y: u128) {\n loop {\n if (x > y) {\n- y = y + 1;\n+ y = y % 1;\n continue\n };\n if (y > x) {\n", + "--- original\n+++ modified\n@@ -68,7 +68,7 @@\n fun sample4(x: u128, y: u128) {\n loop {\n if (x > y) {\n- y = y + 1;\n+ y = y + 0;\n continue\n };\n if (y > x) {\n", + "--- original\n+++ modified\n@@ -68,7 +68,7 @@\n fun sample4(x: u128, y: u128) {\n loop {\n if (x > y) {\n- y = y + 1;\n+ y = y + 340282366920938463463374607431768211455;\n continue\n };\n if (y > x) {\n", + "--- original\n+++ modified\n@@ -68,7 +68,7 @@\n fun sample4(x: u128, y: u128) {\n loop {\n if (x > y) {\n- y = y + 1;\n+ y = y + 0;\n continue\n };\n if (y > x) {\n", + "--- original\n+++ modified\n@@ -71,7 +71,7 @@\n y = y + 1;\n continue\n };\n- if (y > x) {\n+ if (true) {\n x = x + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -71,7 +71,7 @@\n y = y + 1;\n continue\n };\n- if (y > x) {\n+ if (!(y > x)) {\n x = x + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -71,7 +71,7 @@\n y = y + 1;\n continue\n };\n- if (y > x) {\n+ if (y == x) {\n x = x + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -71,7 +71,7 @@\n y = y + 1;\n continue\n };\n- if (y > x) {\n+ if (y <= x) {\n x = x + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -71,7 +71,7 @@\n y = y + 1;\n continue\n };\n- if (y > x) {\n+ if (y >= x) {\n x = x + 1;\n continue\n };\n", + "--- original\n+++ modified\n@@ -72,7 +72,7 @@\n continue\n };\n if (y > x) {\n- x = x + 1;\n+ x = x - 1;\n continue\n };\n break\n", + "--- original\n+++ modified\n@@ -72,7 +72,7 @@\n continue\n };\n if (y > x) {\n- x = x + 1;\n+ x = x * 1;\n continue\n };\n break\n", + "--- original\n+++ modified\n@@ -72,7 +72,7 @@\n continue\n };\n if (y > x) {\n- x = x + 1;\n+ x = x / 1;\n continue\n };\n break\n", + "--- original\n+++ modified\n@@ -72,7 +72,7 @@\n continue\n };\n if (y > x) {\n- x = x + 1;\n+ x = x % 1;\n continue\n };\n break\n", + "--- original\n+++ modified\n@@ -72,7 +72,7 @@\n continue\n };\n if (y > x) {\n- x = x + 1;\n+ x = x + 0;\n continue\n };\n break\n", + "--- original\n+++ modified\n@@ -72,7 +72,7 @@\n continue\n };\n if (y > x) {\n- x = x + 1;\n+ x = x + 340282366920938463463374607431768211455;\n continue\n };\n break\n", + "--- original\n+++ modified\n@@ -72,7 +72,7 @@\n continue\n };\n if (y > x) {\n- x = x + 1;\n+ x = x + 0;\n continue\n };\n break\n", + "--- original\n+++ modified\n@@ -75,7 +75,7 @@\n x = x + 1;\n continue\n };\n- break\n+ continue\n };\n }\n\n", + "--- original\n+++ modified\n@@ -75,7 +75,7 @@\n x = x + 1;\n continue\n };\n- break\n+ {}\n };\n }\n\n" + ] + }, + { + "module_func": "StillSimple::sample5", + "tested": 20, + "killed": 20, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) - (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) * (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) / (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) % (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x + 1 as u128) + (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x * 1 as u128) + (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x / 1 as u128) + (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x % 1 as u128) + (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 0 as u128) + (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 340282366920938463463374607431768211455 as u128) + (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 2 as u128) + (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 0 as u128) + (y - 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) + (y + 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) + (y * 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) + (y / 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) + (y % 1 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) + (y - 0 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) + (y - 340282366920938463463374607431768211455 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) + (y - 2 as u128)\n }\n\n #[test]\n", + "--- original\n+++ modified\n@@ -88,7 +88,7 @@\n }\n\n fun sample5(x: u128, y: u128): u128 {\n- (x - 1 as u128) + (y - 1 as u128)\n+ (x - 1 as u128) + (y - 0 as u128)\n }\n\n #[test]\n" + ] + }, + { + "module_func": "StillSimple::sample6", + "tested": 28, + "killed": 28, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y + x*(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y * x*(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y / x*(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y % x*(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x - y - x*(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x * y - x*(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x / y - x*(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x % y - x*(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 2)*x+y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 2)*x-y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 2)*x*y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 2)*x%y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 2)+x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 2)-x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 2)/x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 2)%x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x+(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x-(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x/(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x%(y + 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y - 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y * 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y / 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y % 2)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 0)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 340282366920938463463374607431768211455)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 3)*x/y)\n }\n\n #[test, expected_failure]\n", + "--- original\n+++ modified\n@@ -123,7 +123,7 @@\n }\n\n fun sample6(x: u128, y: u128): u128 {\n- return (x + y - x*(y + 2)*x/y)\n+ return (x + y - x*(y + 1)*x/y)\n }\n\n #[test, expected_failure]\n" + ] + } + ], + "sources/Sum.move": [ + { + "module_func": "Sum::sum", + "tested": 4, + "killed": 4, + "mutants_alive_diffs": [], + "mutants_killed_diff": [ + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::Sum {\n fun sum(x: u128, y: u128): u128 {\n- let sum_r = x + y;\n+ let sum_r = x - y;\n spec {\n assert sum_r == x+y;\n };\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::Sum {\n fun sum(x: u128, y: u128): u128 {\n- let sum_r = x + y;\n+ let sum_r = x * y;\n spec {\n assert sum_r == x+y;\n };\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::Sum {\n fun sum(x: u128, y: u128): u128 {\n- let sum_r = x + y;\n+ let sum_r = x / y;\n spec {\n assert sum_r == x+y;\n };\n", + "--- original\n+++ modified\n@@ -1,6 +1,6 @@\n module TestAccount::Sum {\n fun sum(x: u128, y: u128): u128 {\n- let sum_r = x + y;\n+ let sum_r = x % y;\n spec {\n assert sum_r == x+y;\n };\n" + ] + } + ] + }, + "package_dir": "move-spec-testing/move-mutator/tests/move-assets/simple" +} diff --git a/mutator-common/src/report.rs b/mutator-common/src/report.rs index d09bfeaff9..b54346e2a3 100644 --- a/mutator-common/src/report.rs +++ b/mutator-common/src/report.rs @@ -57,9 +57,9 @@ impl MiniReport { #[derive(Default, Debug, Serialize, Deserialize)] pub struct Report { /// The list of entries in the report. - files: BTreeMap>, + pub files: BTreeMap>, /// Package directory location. - package_dir: PathBuf, + pub package_dir: PathBuf, } impl Report { @@ -134,10 +134,15 @@ impl Report { Ok(serde_json::to_writer_pretty(file, self)?) } - /// Load the report from a JSON file. + /// Load the report from a JSON file pub fn load_from_json_file(path: &Path) -> anyhow::Result { let report = fs::read_to_string(path)?; - serde_json::from_str::(&report) + Self::load_from_str(report) + } + + /// Load the report from a string. + pub fn load_from_str>(report: P) -> anyhow::Result { + serde_json::from_str::(report.as_ref()) .map_err(|e| anyhow::Error::msg(format!("failed to parse the report: {e}"))) } @@ -210,7 +215,7 @@ impl Report { /// This struct represents an entry in the report. /// It contains the number of mutants tested and killed. -#[derive(Default, Debug, Serialize, Deserialize)] +#[derive(Default, Debug, Serialize, Deserialize, PartialEq, PartialOrd, Clone)] pub struct MutantStats { /// Module::function where mutant resides. pub module_func: String,