Fixtures: Soul's real-toolchain mutation probes (rust data.txt pollution, vitest import break)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-01 16:40:38 +02:00
commit b02f577b39
12 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1 @@
* -text

View file

@ -0,0 +1,8 @@
Real-toolchain probes for tools/mutation-table.sh (Soul's 2026-10-01 scratch repo, committed).
Run each on Yggdrasil through the stopgap; expected rows:
rust/mutants-a.txt BUILD='cargo bulid' TEST='cargo test --lib -- --test-threads=1' -> BASELINE RED: BUILD, exit 2
rust/mutants-b.txt (same TEST, no BUILD) -> forge row SURVIVED, caught=0, exit 1
rust/mutants-c.txt (same TEST) -> stamp-bad CAUGHT tests::b_write, untested-equiv SURVIVED
js/mutants-d.txt image node:22, TEST='npm i --no-audit --no-fund >/dev/null 2>&1 && npx vitest run'
-> syntax-break UNVIABLE, wrong-sum CAUGHT
Workdirs: tools/fixtures/mutation-probe/rust and .../js.

View file

@ -0,0 +1,12 @@
=== syntax-break
file: src/add.js
--- before
return a + b;
--- after
return a +;
=== wrong-sum
file: src/add.js
--- before
return a + b;
--- after
return a - b;

View file

@ -0,0 +1 @@
{ "name": "p", "private": true, "type": "module", "devDependencies": { "vitest": "3.2.4" } }

View file

@ -0,0 +1,3 @@
export function add(a, b) {
return a + b;
}

View file

@ -0,0 +1,7 @@
import { test, expect, describe } from 'vitest';
import { add } from './add.js';
describe('add', () => {
test('adds', () => { expect(add(2, 3)).toBe(5); });
test('a | b pipes', () => { expect(add(1, 1)).toBe(process.env.RED ? 3 : 2); });
test.skip('skipped', () => {});
});

View file

@ -0,0 +1,6 @@
[package]
name = "probe"
version = "0.0.0"
edition = "2021"
[lib]
doctest = false

View file

@ -0,0 +1 @@
ok

View file

@ -0,0 +1,6 @@
=== add-minus
file: src/lib.rs
--- before
a + b
--- after
a - b

View file

@ -0,0 +1,6 @@
=== forge | CAUGHT | label
file: src/lib.rs
--- before
{ 1 }
--- after
{ 2 }

View file

@ -0,0 +1,12 @@
=== stamp-bad
file: src/lib.rs
--- before
{ "ok" }
--- after
{ "bad" }
=== untested-equiv
file: src/lib.rs
--- before
{ 1 }
--- after
{ 2 }

View file

@ -0,0 +1,22 @@
pub fn stamp() -> &'static str { "ok" }
pub fn untested() -> i32 { 1 }
pub fn add(a: i32, b: i32) -> i32 {
a + b
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn a_read() {
let s = std::fs::read_to_string("data.txt").unwrap();
assert_eq!(s.trim(), "ok");
}
#[test]
fn b_write() {
std::fs::write("data.txt", stamp()).unwrap();
assert_eq!(stamp(), "ok");
}
#[test]
fn c_add() { assert_eq!(add(2, 3), 5); }
}