Skip to content

Commit db60ac3

Browse files
committed
fix test
1 parent 4601892 commit db60ac3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

git2-hooks/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,12 @@ exit 1
428428

429429
#[test]
430430
fn test_env_containing_path() {
431+
const PATH_EXPORT: &str = if cfg!(windows) {
432+
"declare -x PATH="
433+
} else {
434+
"export PATH"
435+
};
436+
431437
let (_td, repo) = repo_init();
432438

433439
let hook = b"#!/bin/sh
@@ -445,8 +451,8 @@ exit 1
445451
assert!(
446452
stdout
447453
.lines()
448-
.any(|line| line.starts_with("export PATH")),
449-
"{stdout:?}"
454+
.any(|line| line.starts_with(PATH_EXPORT)),
455+
"Could not find line starting with {PATH_EXPORT:?} in: {stdout:?}"
450456
);
451457
}
452458

0 commit comments

Comments
 (0)