test diff

[?]
Jun 3, 2025, 7:06 PM
2LWMGRUM2OLIJHW7XW4HSISIHJAV3JFCWQYRWYV2P2VMSFHJ5CKQC

Dependencies

Change contents

  • edit in libflorescence/src/testing.rs at line 15
    [6.44]
    [2.177]
    pub const DEFAULT_IGNORE_FILE: &str = ".ignore";
  • replacement in libflorescence/src/testing.rs at line 79
    [5.671][5.671:749]()
    let file_to_record = ".ignore";
    repo::add(&mut repo, file_to_record);
    [5.671]
    [5.749]
    repo::add(&mut repo, DEFAULT_IGNORE_FILE);
  • replacement in libflorescence/src/repo/test.rs at line 3
    [6.282][6.282:358]()
    repo_path, setup_test_repo, setup_test_repo_in_subdir, INITIAL_LOG_LEN,
    [6.282]
    [6.358]
    repo_path, setup_test_repo, setup_test_repo_in_subdir, DEFAULT_IGNORE_FILE,
    INITIAL_LOG_LEN,
  • edit in libflorescence/src/repo/test.rs at line 98
    [6.679]
    [6.679]
    // Make a change to a tracked file
    std::fs::write(repo_path.join(DEFAULT_IGNORE_FILE), "some content")
    .unwrap();
  • edit in libflorescence/src/repo/test.rs at line 103
    [6.680]
    [6.680]
    // Record it
  • edit in libflorescence/src/repo/test.rs at line 105
    [6.727][6.727:799]()
    std::fs::write(repo_path.join(".ignore"), "some content").unwrap();
  • edit in libflorescence/src/repo/test.rs at line 109
    [6.964]
    [5.3687]
    }
    #[test]
    fn test_diff() {
    let repo = setup_test_repo();
    let repo_path = repo_path(&repo);
    let (internal, _state) = repo::load(repo_path.clone()).unwrap();
    let adiff = repo::diff(&internal.repo);
    assert!(adiff.changes.is_empty());
    // Make a change to a tracked file
    std::fs::write(repo_path.join(DEFAULT_IGNORE_FILE), "some content")
    .unwrap();
    let adiff = repo::diff(&internal.repo);
    assert_eq!(adiff.changes.len(), 1);
    assert_matches!(
    adiff.changes.get(0).unwrap(),
    libpijul::change::BaseHunk::Replacement { .. }
    );
  • replacement in inflorescence/src/test.rs at line 11
    [5.3792][7.74:95]()
    INITIAL_LOG_LEN,
    [5.3792]
    [3.1578]
    DEFAULT_IGNORE_FILE, INITIAL_LOG_LEN,
  • replacement in inflorescence/src/test.rs at line 760
    [4.2742][5.3934:3982]()
    assert_eq!(log[0].file_paths, [".ignore"]);
    [4.2742]
    [3.7182]
    assert_eq!(log[0].file_paths, [DEFAULT_IGNORE_FILE]);