blob: ca5d8cbad5215ea72c436c8b826e2b573e3636c4 [file] [log] [blame]
use gix_glob::{pattern::Mode, Pattern};
#[test]
fn display() {
fn pat(text: &str, mode: Mode) -> String {
Pattern {
text: text.into(),
mode,
first_wildcard_pos: None,
}
.to_string()
}
assert_eq!(pat("a", Mode::ABSOLUTE), "/a");
assert_eq!(pat("a", Mode::MUST_BE_DIR), "a/");
assert_eq!(pat("a", Mode::NEGATIVE), "!a");
assert_eq!(pat("a", Mode::ABSOLUTE | Mode::NEGATIVE | Mode::MUST_BE_DIR), "!/a/");
}
mod matching;