Fixing some failing tests

pmeunier
Jan 25, 2026, 3:56 PM
4NEVLBWGDGBPVQZ33IIFBAZO7HWK54AD23LL5AZMDXI4MHKP546QC

Dependencies

  • [2] MCAUAMZZ fix libpijul tests, and an unnecessary clone
  • [3] FBHUMBZT Fixing an off-by-one error in conflict resolutions, when one side of a conflict contains a "last line in file" without a \n
  • [4] 7FP2DFNX Optimisation: avoid re-checking the entire repo when recording after an unrecord
  • [5] I24UEJQL Various post-fire fixes
  • [6] Q6MRVSJX Higher resolution for status change times on Unix, and coarser test for 1-second-resolution filesystems
  • [7] GHO6DWPI Refactoring iterators
  • [8] N5XHCYVT Remove use of unsafe
  • [9] UAFZU2RY Fixing the tests
  • [10] QNJBR73K don't return Result for infallible functions
  • [11] FXEDPLRI Resurrecting tests, and type cleanup (no need for Arc<RwLock<…>> anymore)
  • [12] V4T4SC7O Testing binary diff
  • [13] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [14] I52XSRUH Massive cleanup, and simplification
  • [*] IYJZVLET Cleaning up the literate programming bits
  • [*] KVBLRDOU Concatenating edits with order conflict resolutions (if relevant), and parsing the text format of the result

Change contents

  • edit in libpijul/src/working_copy/filesystem.rs at line 490
    [4.1768][4.1768:1810]()
    let src = std::fs::metadata(&p)?;
  • replacement in libpijul/src/tests/missing_context.rs at line 74
    [5.293696][2.328:376]()
    repo_alice.remove_path("file", false)?;
    [5.293696]
    [5.293737]
    repo_alice.remove_path("file", false).unwrap();
  • edit in libpijul/src/tests/missing_context.rs at line 94
    [5.294266]
    [5.13998]
    {
    let txn = txn_alice.read();
    let graph = channel_alice.read();
    let mut f = std::fs::File::create("alice0").unwrap();
    crate::pristine::debug(&*txn, &txn.graph(&*graph), &mut f).unwrap();
    }
  • edit in libpijul/src/tests/missing_context.rs at line 120
    [5.22756]
    [5.14402]
    // panic!("{:?}", repo_alice.list_files());
    {
    let txn = txn_alice.read();
    let graph = channel_alice.read();
    let mut f = std::fs::File::create("alice1").unwrap();
    crate::pristine::debug(&*txn, &txn.graph(&*graph), &mut f).unwrap();
    }
  • replacement in libpijul/src/tests/missing_context.rs at line 130
    [5.294358][5.294358:294403]()
    repo_alice.read_file("file", &mut buf)?;
    [5.294358]
    [5.294403]
    repo_alice.read_file("file", &mut buf).unwrap();
  • replacement in libpijul/src/tests/diff.rs at line 3
    [5.205][5.205:244]()
    use rand::distributions::Alphanumeric;
    [5.205]
    [5.244]
    use rand::distr::Alphanumeric;
  • edit in libpijul/src/tests/conflict.rs at line 1123
    [5.389412]
    [5.389476]
    info!("resolving {:?}", std::time::SystemTime::now());
  • edit in libpijul/src/tests/conflict.rs at line 1134
    [5.61291][5.389752:389776](),[5.389752][5.389752:389776]()
    info!("resolving");
  • edit in libpijul/src/tests/conflict.rs at line 1170
    [5.390813]
    [5.390813]
    crate::pristine::debug(
    &*txn.read(),
    &*channel_alice.read(),
    std::fs::File::create("alice.dot").unwrap(),
    )?;
    crate::pristine::debug(
    &*txn.read(),
    &*channel_bob.read(),
    std::fs::File::create("bob.dot").unwrap(),
    )?;
  • edit in libpijul/src/tests/conflict.rs at line 1242
    [5.392890]
    [5.62456]
    debug!("apply Bob's change");
  • edit in libpijul/src/tests/conflict.rs at line 1244
    [5.62526]
    [5.392963]
    crate::pristine::debug(
    &*txn.read(),
    &*channel_alice.read(),
    std::fs::File::create("alice.dot").unwrap(),
    )?;
  • edit in libpijul/src/tests/conflict.rs at line 1270
    [5.393580]
    [5.393644]
    check_conflict(&buf)?;
  • replacement in libpijul/src/record.rs at line 917
    [5.643][5.643:817]()
    let channel_mod = if last_mod % 1000 == 0 {
    (txn.last_modified(channel) / 1000) * 1000
    } else {
    txn.last_modified(channel)
    };
    [5.643]
    [4.10453]
    let channel_mod = (txn.last_modified(channel) / 1000) * 1000;
  • edit in libpijul/src/diff/replace.rs at line 10
    [16.1]
    [5.780322]
    #[derive(Debug)]
  • replacement in libpijul/src/diff/replace.rs at line 46
    [5.781307][5.85845:85846]()
    [5.781307]
    [5.104580]
    debug!("up_context {:?}", up_context);
  • edit in libpijul/src/diff/replace.rs at line 86
    [17.45]
    [5.782161]
    debug!("change {:?}", change);
  • edit in libpijul/src/diff/replace.rs at line 131
    [5.783287]
    [5.783346]
    debug!("get_up_context {:?}", old);
  • edit in libpijul/src/diff/replace.rs at line 147
    [5.783974]
    [5.784105]
    debug!(
    "marker {:?}",
    diff.marker.get(&diff.pos_a[up_context_idx].pos)
    );
  • edit in libpijul/src/diff/replace.rs at line 167
    [3.488]
    [3.488]
    debug!("{:?} {:?} {:?}", pos.0, offset, v_end);
  • edit in libpijul/src/diff/replace.rs at line 176
    [3.826]
    [5.784608]
    debug!("pos {:?}", pos.0 + offset);
  • edit in libpijul/src/diff/replace.rs at line 193
    [5.785425]
    [5.785425]
    debug!("up {:?}", pos);
  • edit in libpijul/src/diff/replace.rs at line 264
    [5.787932]
    [5.787991]
    debug!("get down context");
  • edit in libpijul/src/diff/replace.rs at line 344
    [5.790996]
    [5.790996]
    debug!("get_down_context_conflict");
  • edit in libpijul/src/diff/mod.rs at line 223
    [5.800749]
    [5.800804]
    // Position of the first byte in chunks[old].
    //
    // This assumes that all lines in `chunks` come from the same memory region.
  • edit in libpijul/src/diff/mod.rs at line 237
    [5.800980]
    [5.801035]
    // Total length (i.e. sum of lengths) in bytes of lines `&chunks[old...old+len]`.
    //
    // This assumes that all lines in `chunks` come from the same memory region.