summaryrefslogtreecommitdiffstats
path: root/tests/git.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/git.rs22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/git.rs b/tests/git.rs
index 19eced1..7a28076 100644
--- a/tests/git.rs
+++ b/tests/git.rs
@@ -1,3 +1,10 @@
1/*
2 * This file is part of agent686
3 * Copyright (C) 2026 Salmonik <salmon@2137697.xyz>
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 * https://git.2137697.xyz/agent686
6 */
7
1use std::fs; 8use std::fs;
2use std::path::PathBuf; 9use std::path::PathBuf;
3use std::process::Command; 10use std::process::Command;
@@ -18,9 +25,13 @@ fn repo(tag: &str) -> PathBuf {
18 &["config", "user.email", "agent686@test"][..], 25 &["config", "user.email", "agent686@test"][..],
19 &["config", "user.name", "agent686"][..], 26 &["config", "user.name", "agent686"][..],
20 ] { 27 ] {
21 assert!( 28 assert!(Command::new("git")
22 Command::new("git").arg("-C").arg(&dir).args(args).status().unwrap().success() 29 .arg("-C")
23 ); 30 .arg(&dir)
31 .args(args)
32 .status()
33 .unwrap()
34 .success());
24 } 35 }
25 dir 36 dir
26} 37}
@@ -40,7 +51,10 @@ fn checkpoint_then_undo_restores_the_tree() {
40 git::undo(&dir, &sha); 51 git::undo(&dir, &sha);
41 52
42 assert_eq!(fs::read_to_string(dir.join("a.txt")).unwrap(), "original\n"); 53 assert_eq!(fs::read_to_string(dir.join("a.txt")).unwrap(), "original\n");
43 assert!(!dir.join("b.txt").exists(), "untracked files must be removed"); 54 assert!(
55 !dir.join("b.txt").exists(),
56 "untracked files must be removed"
57 );
44} 58}
45 59
46#[test] 60#[test]