aboutsummaryrefslogtreecommitdiff
path: root/helix-vcs/src/git
diff options
context:
space:
mode:
Diffstat (limited to 'helix-vcs/src/git')
-rw-r--r--helix-vcs/src/git/test.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/helix-vcs/src/git/test.rs b/helix-vcs/src/git/test.rs
index 6b1aba7f..9c67d2c3 100644
--- a/helix-vcs/src/git/test.rs
+++ b/helix-vcs/src/git/test.rs
@@ -54,7 +54,7 @@ fn missing_file() {
let file = temp_git.path().join("file.txt");
File::create(&file).unwrap().write_all(b"foo").unwrap();
- assert_eq!(Git.get_diff_base(&file), None);
+ assert!(Git.get_diff_base(&file).is_err());
}
#[test]
@@ -64,7 +64,7 @@ fn unmodified_file() {
let contents = b"foo".as_slice();
File::create(&file).unwrap().write_all(contents).unwrap();
create_commit(temp_git.path(), true);
- assert_eq!(Git.get_diff_base(&file), Some(Vec::from(contents)));
+ assert_eq!(Git.get_diff_base(&file).unwrap(), Vec::from(contents));
}
#[test]
@@ -76,7 +76,7 @@ fn modified_file() {
create_commit(temp_git.path(), true);
File::create(&file).unwrap().write_all(b"bar").unwrap();
- assert_eq!(Git.get_diff_base(&file), Some(Vec::from(contents)));
+ assert_eq!(Git.get_diff_base(&file).unwrap(), Vec::from(contents));
}
/// Test that `get_file_head` does not return content for a directory.
@@ -95,7 +95,7 @@ fn directory() {
std::fs::remove_dir_all(&dir).unwrap();
File::create(&dir).unwrap().write_all(b"bar").unwrap();
- assert_eq!(Git.get_diff_base(&dir), None);
+ assert!(Git.get_diff_base(&dir).is_err());
}
/// Test that `get_file_head` does not return content for a symlink.
@@ -116,6 +116,6 @@ fn symlink() {
symlink("file.txt", &file_link).unwrap();
create_commit(temp_git.path(), true);
- assert_eq!(Git.get_diff_base(&file_link), None);
- assert_eq!(Git.get_diff_base(&file), Some(Vec::from(contents)));
+ assert!(Git.get_diff_base(&file_link).is_err());
+ assert_eq!(Git.get_diff_base(&file).unwrap(), Vec::from(contents));
}