Commit 35bfe7ef authored by Brad King's avatar Brad King

Merge branch 'reject-paths-check-windows-rules'

62f175b7 invalid_paths: support enforcing Windows filename rules
e14fac05 Merge branch 'reject-windows-paths' into HEAD
fa71fbb9 invalid_paths: simplify invalid character detection
6f787f04 invalid_paths: mention control characters
Reviewed-by: Brad King's avatarBrad King <brad.king@kitware.com>
Merge-request: !131
parents dd843737 62f175b7
Pipeline #138610 failed with stage
in 0 seconds
......@@ -25,6 +25,7 @@
conflict resolution path regardless whether the base file exists or not.
* The `Changelog` now requires that changelog file contents change. Changing
the mode on a changelog file is no longer sufficient.
* The `InvalidPaths` check now supports enforcing Windows filename rules.
# v3.9.0
......
......@@ -21,17 +21,27 @@ pub struct InvalidPaths {
invalid_characters: String,
/// Allow the space character (ASCII x20)
allow_space: bool,
/// Reject paths which are invalid on Windows.
enforce_windows_rules: bool,
}
const WINDOWS_FORBIDDEN_ASCII: &[u8] = br#"<>:"\|?*"#;
const WINDOWS_FORBIDDEN_NAMES: &[&[u8]] = &[
b"CON", b"PRN", b"AUX", b"NUL", b"COM1", b"COM2", b"COM3", b"COM4", b"COM5", b"COM6", b"COM7",
b"COM8", b"COM9", b"LPT1", b"LPT2", b"LPT3", b"LPT4", b"LPT5", b"LPT6", b"LPT7", b"LPT8",
b"LPT9",
];
impl InvalidPaths {
/// Create a check which rejects paths which contain invalid characters.
///
/// In addition to whitespace and non-ASCII characters, the characters given here are also
/// disallowed.
/// In addition to whitespace, control, and non-ASCII characters, the characters given here are
/// also disallowed.
pub fn new<S: ToString>(chars: S) -> Self {
Self {
invalid_characters: chars.to_string(),
allow_space: false,
enforce_windows_rules: false,
}
}
......@@ -43,6 +53,12 @@ impl InvalidPaths {
self
}
/// Whether to allow paths which are invalid on Windows.
pub fn enforce_windows_rules(&mut self, enforce_windows_rules: bool) -> &mut Self {
self.enforce_windows_rules = enforce_windows_rules;
self
}
fn disallowed_whitespace(&self, c: char) -> bool {
c.is_whitespace() && (!self.allow_space || c != ' ')
}
......@@ -52,7 +68,7 @@ impl InvalidPaths {
chars.chars()
.any(|ref c| {
!c.is_ascii() || self.disallowed_whitespace(*c) || c.is_control() ||
self.invalid_characters.chars().any(|ref ic| ic == c)
self.invalid_characters.contains(*c)
})
}
......@@ -61,6 +77,21 @@ impl InvalidPaths {
bytes.iter()
.any(|&c| !c.is_ascii() || c < 32)
}
/// Whether the string has any invalid bytes.
///
/// See https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file for rules.
fn is_valid_for_windows(chars: &[u8]) -> bool {
// Check for invalid characters.
!chars.iter().any(|ref c| WINDOWS_FORBIDDEN_ASCII.contains(*c)) &&
// Check component names.
!chars.split(|&b| b == b'/')
.any(|name| {
name.ends_with(b" ") ||
name.ends_with(b".") ||
WINDOWS_FORBIDDEN_NAMES.contains(&name)
})
}
}
impl ContentCheck for InvalidPaths {
......@@ -84,6 +115,12 @@ impl ContentCheck for InvalidPaths {
diff.name,
self.invalid_characters));
}
if self.enforce_windows_rules && !Self::is_valid_for_windows(diff.name.as_bytes()) {
result.add_error(format!("{}adds the `{}` path which is invalid on Windows.",
commit_prefix(content),
diff.name));
}
}
}
......@@ -98,6 +135,8 @@ mod tests {
const BAD_TOPIC: &str = "f536f44cf96b82e479d4973d5ea1cf78058bd1fb";
const FIX_TOPIC: &str = "8ff69e1834ef2e82c0ed5cfb4ba56f1e4de85d03";
const BAD_WINDOWS_TOPIC: &str = "6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5";
const FIX_WINDOWS_TOPIC: &str = "e2130533af8b9c274c82ad8cdede5fdbb8053c7b";
#[test]
fn test_allow_space() {
......@@ -111,6 +150,75 @@ mod tests {
assert!(check.disallowed_whitespace('\n'));
}
#[test]
fn test_valid_windows_characters() {
assert!(!InvalidPaths::is_valid_for_windows(b"with<langle"));
assert!(!InvalidPaths::is_valid_for_windows(b"with>rangle"));
assert!(!InvalidPaths::is_valid_for_windows(b"with>rangle"));
assert!(!InvalidPaths::is_valid_for_windows(b"with:colon"));
assert!(!InvalidPaths::is_valid_for_windows(b"with\"dquote"));
assert!(!InvalidPaths::is_valid_for_windows(b"with\\slash"));
assert!(!InvalidPaths::is_valid_for_windows(b"with|vbar"));
assert!(!InvalidPaths::is_valid_for_windows(b"with?question"));
assert!(!InvalidPaths::is_valid_for_windows(b"with*asterisk"));
}
#[test]
fn test_valid_windows_suffixes() {
assert!(!InvalidPaths::is_valid_for_windows(b"ends.with."));
assert!(!InvalidPaths::is_valid_for_windows(b"ends.with "));
assert!(!InvalidPaths::is_valid_for_windows(b"dir.ends.with./file"));
assert!(!InvalidPaths::is_valid_for_windows(b"dir.ends.with /file"));
}
#[test]
fn test_valid_windows_reserved_names() {
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/CON"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/PRN"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/AUX"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/NUL"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM1"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM2"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM3"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM4"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM5"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM6"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM7"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM8"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM9"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT1"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT2"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT3"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT4"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT5"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT6"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT7"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT8"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT9"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/CON/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/PRN/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/AUX/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/NUL/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM1/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM2/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM3/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM4/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM5/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM6/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM7/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM8/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/COM9/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT1/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT2/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT3/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT4/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT5/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT6/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT7/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT8/as/dir"));
assert!(!InvalidPaths::is_valid_for_windows(b"forbidden/name/LPT9/as/dir"));
}
#[test]
fn test_invalid_paths() {
let check = InvalidPaths::new("$");
......@@ -233,4 +341,163 @@ mod tests {
let check = InvalidPaths::default();
run_topic_check_ok("test_invalid_paths_topic_fixed", FIX_TOPIC, check);
}
#[test]
fn test_invalid_paths_topic_windows_ignore() {
let mut check = InvalidPaths::default();
// Ignore the space in the path name testing path suffixes.
check.allow_space(true);
run_topic_check_ok("test_invalid_paths_topic_windows_ignore", BAD_WINDOWS_TOPIC, check);
}
#[test]
fn test_invalid_paths_windows() {
let mut check = InvalidPaths::default();
check.allow_space(true);
check.enforce_windows_rules(true);
let result = run_check("test_invalid_paths_windows", BAD_WINDOWS_TOPIC, check);
test_result_errors(result, &[
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `"invalid-char-\"-dir/subdir"` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `"invalid-char-\"-file"` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-char-*-dir/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-char-*-file` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-char-:-dir/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-char-:-file` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-char-<-dir/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-char-<-file` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-char->-dir/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-char->-file` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-char-?-dir/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-char-?-file` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `"invalid-char-\\-dir/subdir"` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `"invalid-char-\\-file"` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/AUX/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/COM1/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/COM2/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/COM3/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/COM4/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/COM5/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/COM6/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/COM7/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/COM8/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/COM9/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/CON/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/LPT1/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/LPT2/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/LPT3/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/LPT4/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/LPT5/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/LPT6/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/LPT7/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/LPT8/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/LPT9/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/NUL/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/dirs/PRN/subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/AUX` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/COM1` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/COM2` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/COM3` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/COM4` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/COM5` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/COM6` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/COM7` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/COM8` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/COM9` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/CON` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/LPT1` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/LPT2` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/LPT3` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/LPT4` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/LPT5` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/LPT6` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/LPT7` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/LPT8` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/LPT9` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/NUL` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-names/files/PRN` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-suffix-dir- /subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-suffix-dir-./subdir` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-suffix-file- ` path which is invalid on Windows."#,
r#"commit 6354b8d1b1c247d0e35faf2de3ab1be0b7e582a5 adds the `invalid-suffix-file-.` path which is invalid on Windows."#,
]);
}
#[test]
fn test_invalid_paths_windows_topic() {
let mut check = InvalidPaths::default();
check.allow_space(true);
check.enforce_windows_rules(true);
let result = run_topic_check("test_invalid_paths_windows_topic", BAD_WINDOWS_TOPIC, check);
test_result_errors(result, &[
r#"adds the `"invalid-char-\"-dir/subdir"` path which is invalid on Windows."#,
r#"adds the `"invalid-char-\"-file"` path which is invalid on Windows."#,
r#"adds the `invalid-char-*-dir/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-char-*-file` path which is invalid on Windows."#,
r#"adds the `invalid-char-:-dir/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-char-:-file` path which is invalid on Windows."#,
r#"adds the `invalid-char-<-dir/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-char-<-file` path which is invalid on Windows."#,
r#"adds the `invalid-char->-dir/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-char->-file` path which is invalid on Windows."#,
r#"adds the `invalid-char-?-dir/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-char-?-file` path which is invalid on Windows."#,
r#"adds the `"invalid-char-\\-dir/subdir"` path which is invalid on Windows."#,
r#"adds the `"invalid-char-\\-file"` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/AUX/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/COM1/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/COM2/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/COM3/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/COM4/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/COM5/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/COM6/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/COM7/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/COM8/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/COM9/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/CON/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/LPT1/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/LPT2/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/LPT3/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/LPT4/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/LPT5/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/LPT6/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/LPT7/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/LPT8/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/LPT9/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/NUL/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/dirs/PRN/subdir` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/AUX` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/COM1` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/COM2` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/COM3` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/COM4` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/COM5` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/COM6` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/COM7` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/COM8` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/COM9` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/CON` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/LPT1` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/LPT2` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/LPT3` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/LPT4` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/LPT5` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/LPT6` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/LPT7` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/LPT8` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/LPT9` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/NUL` path which is invalid on Windows."#,
r#"adds the `invalid-names/files/PRN` path which is invalid on Windows."#,
r#"adds the `invalid-suffix-dir- /subdir` path which is invalid on Windows."#,
r#"adds the `invalid-suffix-dir-./subdir` path which is invalid on Windows."#,
r#"adds the `invalid-suffix-file- ` path which is invalid on Windows."#,
r#"adds the `invalid-suffix-file-.` path which is invalid on Windows."#,
]);
}
#[test]
fn test_invalid_paths_windows_topic_fixed() {
let mut check = InvalidPaths::default();
check.enforce_windows_rules(true);
run_topic_check_ok("test_invalid_paths_windows_topic_fixed", FIX_WINDOWS_TOPIC, check);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment