History

Add more tests.

Svetlin Stefanov committed 4 years ago

Commit db1204d1 parent 52db5e81 file · +24 −0Browse files

Unified · Split

git-config/tests/file/from_paths/includes/conditional/gitdir.rs+24−0
@@ -141,6 +141,7 @@ fn write_main_config( · 140 unmodified lines
141 if overwrite_config_location == &ConfigLocation::Repo {141 if overwrite_config_location == &ConfigLocation::Repo {
142 Command::new("git")142 Command::new("git")
143 .args(["config", "section.value", "base-value"])143 .args(["config", "section.value", "base-value"])
144 .env("GIT_DIR", git_dir)
144 .output()145 .output()
145 .unwrap();146 .unwrap();
146 }147 }
@@ -213,6 +214,17 @@ fn star_star_prefix_and_suffix() { · 66 unmodified lines
213 });214 });
214}215}
215 216
217#[test]
218#[serial]
219fn dot_path_slash() {
220 assert_section_value(Options {
221 condition: "gitdir:./",
222 git_dir: &git_dir(&tempdir().unwrap(), "foo"),
223 config_location: ConfigLocation::User,
224 ..Default::default()
225 });
226}
227
216#[test]228#[test]
217#[serial]229#[serial]
218fn dot_path() {230fn dot_path() {
@@ -234,6 +246,18 @@ fn case_insensitive() { · 15 unmodified lines
234 });246 });
235}247}
236 248
249#[test]
250#[serial]
251#[ignore]
252fn pattern_with_backslash() {
253 assert_section_value(Options {
254 condition: "gitdir:\\foo/",
255 git_dir: &git_dir(&tempdir().unwrap(), "foo"),
256 expected: Value::Original,
257 ..Default::default()
258 });
259}
260
237#[test]261#[test]
238#[serial]262#[serial]
239fn star_star_in_the_middle() {263fn star_star_in_the_middle() {