test got repo change
[?]
Jun 2, 2025, 5:14 PM
TSFQFCB2NXDOBLBRUSAT63VJIXLPPTJGSTIDNOTLGHVVWSHITRNQCDependencies
- [2]
ACDXXAX2refactor main's updates into smaller fns - [3]
I56UGW7Umake record test, fix log update - [4]
YYKXNBFLtest: add untracked file - [5]
ESMM3FELtest selection reindexing - [6]
KMB6FND3test view update fn rather than direct fn calls - [7]
VCNKFNUFapp init test - [8]
ONRCENKTrm unnecessary state from repo's internal state - [9]
AMPZ2BXKshow changed files diffs (only Edit atm) - [*]
6YZAVBWUInitial commit
Change contents
- replacement in inflorescence/src/test.rs at line 2
use crate::{cursor, init, reindex_selection, task, update, Msg, State};use crate::{cursor, init, reindex_selection, repo_got_change_diffs, task, update, Msg,State,}; - replacement in inflorescence/src/test.rs at line 19
use std::collections::BTreeSet;use std::collections::{BTreeMap, BTreeSet}; - edit in inflorescence/src/test.rs at line 588
let change_hash = |bytes: &[u8]| {let mut hasher = pijul::pristine::Hasher::default();hasher.update(bytes);hasher.finish()}; - edit in inflorescence/src/test.rs at line 655
/// When a repo loads a change diff, it should only be used if the same change/// is still selected#[test(tokio::test)]async fn test_repo_got_change_diffs() {let TestState {mut state,tasks: _tasks,fs_watch_task: _,id: _,repo: _,} = setup_state().await;let change_hash_0 = change_hash(&[0]);let change_hash_1 = change_hash(&[1]);// _________________________________________________________________________// Case: nothing is selectedassert!(state.cursor.selection.is_none());let diffs = BTreeMap::from_iter([]);let task = repo_got_change_diffs(&mut state, change_hash_0, diffs);assert!(task.is_none());assert!(state.cursor.selection.is_none());// _________________________________________________________________________// Case: selection is changedstate.cursor.selection = Some(cursor::Selection::LogChange {ix: 0,hash: change_hash_0,message: "".to_string(),diffs: None,file: None,});let diffs = BTreeMap::from_iter([]);let task = repo_got_change_diffs(&mut state, change_hash_1, diffs);assert!(task.is_none());assert!(state.cursor.selection.is_some());assert_matches!(state.cursor.selection.as_ref().unwrap(),cursor::Selection::LogChange { diffs: None, .. });// _________________________________________________________________________// Case: selection is still the samestate.cursor.selection = Some(cursor::Selection::LogChange {ix: 0,hash: change_hash_1,message: "".to_string(),diffs: None,file: None,});let diffs = BTreeMap::from_iter([]);let task = repo_got_change_diffs(&mut state, change_hash_1, diffs);assert!(task.is_none());assert!(state.cursor.selection.is_some());assert_matches!(state.cursor.selection.as_ref().unwrap(),cursor::Selection::LogChange { diffs: Some(_), .. });} - edit in inflorescence/src/test.rs at line 820
}fn change_hash(bytes: &[u8]) -> pijul::Hash {let mut hasher = pijul::pristine::Hasher::default();hasher.update(bytes);hasher.finish() - replacement in inflorescence/src/main.rs at line 628
// the file for past// changes// the file for past changes