History

Make symlink tests so that they test real-path conversion (#331)

Sebastian Thiel committed 4 years ago

Commit d4fbf2e1 parent 34aed2f1 file · +3 −8Browse files

Unified · Split

git-config/tests/file/from_paths/includes/conditional/gitdir/mod.rs+3−8
@@ -76,10 +76,10 @@ fn absolute_worktree_dir_with_os_separators_matches_with_trailing_glob() -> crat · 75 unmodified lines
7676
7777 #[test]
7878 fn dot_slash_path_is_replaced_with_directory_containing_the_including_config_file() -> crate::Result {
79− // TODO: understand this
8079 assert_section_value(
8180 Condition::new("gitdir:./").set_user_config_instead_of_repo_config(),
8281 GitEnv::repo_name("worktree")?,
82+ // the user configuration is in $HOME, which is parent to $HOME/worktree, and the pattern path ends up being $HOME/**, including worktree/.git
8383 )
8484 }
8585
@@ -160,13 +160,8 @@ fn dot_dot_slash_prefixes_are_not_special_and_are_not_what_you_want() -> crate:: · 74 unmodified lines
160160 }
161161
162162 #[test]
163−#[ignore]
164163 fn leading_dots_are_not_special() -> crate::Result {
165− // TODO: write this test so that it could fail - right now it's naturally correct
166− assert_section_value(
167− Condition::new("gitdir:.hidden/").expect_original_value(),
168− GitEnv::repo_name(".hidden")?,
169− )
164+ assert_section_value(Condition::new("gitdir:.hidden/"), GitEnv::repo_name(".hidden")?)
170165 }
171166
172167 #[test]
@@ -219,7 +214,7 @@ fn star_star_in_the_middle() -> crate::Result { · 46 unmodified lines
219214 #[cfg(not(windows))]
220215 fn tilde_expansion_with_symlink() -> crate::Result {
221216 let env = util::git_env_with_symlinked_repo()?;
222− assert_section_value(Condition::new("gitdir:~/symlink-worktree/"), env)
217+ assert_section_value(Condition::new("gitdir:~/worktree/"), env)
223218 }
224219
225220 #[test]