From d57e10663a2f0c6999c04726fac9a9a18ba4a97d Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 10 Oct 2021 21:35:47 +0200 Subject: Format --- src/actions/create.rs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/actions/create.rs') diff --git a/src/actions/create.rs b/src/actions/create.rs index 2b664b3..c89c3c9 100644 --- a/src/actions/create.rs +++ b/src/actions/create.rs @@ -26,7 +26,14 @@ pub fn create(command_options: ActionOptions, fs: &impl Fs, timestamp: u64) -> R mod tests { use std::path::Path; - use crate::{actions::ActionOptions, diff::ContentChange, filesystem::mock::{EntryMock, FsMock, FsState}, history::{FileChange, FileChangeVariant, FileHistory, RepositoryChange, RepositoryHistory}}; + use crate::{ + actions::ActionOptions, + diff::ContentChange, + filesystem::mock::{EntryMock, FsMock, FsState}, + history::{ + FileChange, FileChangeVariant, FileHistory, RepositoryChange, RepositoryHistory, + }, + }; use super::create; @@ -37,7 +44,7 @@ mod tests { let options = ActionOptions::from_path("."); let expected_index = RepositoryHistory::default().encode().unwrap(); - + create(options, &fs_mock, now).expect("Action failed."); fs_mock.assert_match(FsState::new(vec![ @@ -76,19 +83,19 @@ mod tests { history.encode().unwrap() }; - fs_mock.set_state(FsState::new(vec![ - EntryMock::file("./test", &vec![1, 2, 3]) - ])); + fs_mock.set_state(FsState::new(vec![EntryMock::file( + "./test", + &vec![1, 2, 3], + )])); create(options, &fs_mock, now).expect("Action failed."); fs_mock.assert_match(FsState::new(vec![ EntryMock::file("./test", &vec![1, 2, 3]), - EntryMock::dir("./.ka"), EntryMock::file("./.ka/index", &expected_index), EntryMock::dir("./.ka/files"), EntryMock::file("./.ka/files/test", &expected_file_history), ])) } -} \ No newline at end of file +} -- cgit 1.4.1