1
0

refactor: move something and implement FileName

This commit is contained in:
2026-04-15 15:12:34 +08:00
parent 69c7592f41
commit 1509723ada
7 changed files with 291 additions and 82 deletions

View File

@@ -1,5 +1,5 @@
use std::str::FromStr;
use wfassoc::concept::*;
use wfassoc::win32::concept::*;
// region: File Extension
@@ -230,3 +230,25 @@ fn test_expand_string() {
}
// endregion
// region: File Name
#[test]
fn test_file_name() {
fn ok_tester(s: &str) {
let rv = FileName::from_str(s);
assert!(rv.is_ok());
let rv = rv.unwrap();
assert_eq!(s, rv.inner());
}
fn err_tester(s: &str) {
let rv = FileName::from_str(s);
assert!(rv.is_err());
}
ok_tester("GoodExecutable.exe");
err_tester("*.?xaml");
err_tester(r#"\\\lol///"#);
}
// endregion