mirror of https://github.com/Y2Z/monolith
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.9 KiB
Rust
42 lines
1.9 KiB
Rust
5 years ago
|
// ██████╗ █████╗ ███████╗███████╗██╗███╗ ██╗ ██████╗
|
||
|
// ██╔══██╗██╔══██╗██╔════╝██╔════╝██║████╗ ██║██╔════╝
|
||
|
// ██████╔╝███████║███████╗███████╗██║██╔██╗ ██║██║ ███╗
|
||
|
// ██╔═══╝ ██╔══██║╚════██║╚════██║██║██║╚██╗██║██║ ██║
|
||
|
// ██║ ██║ ██║███████║███████║██║██║ ╚████║╚██████╔╝
|
||
|
// ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝╚═╝ ╚═══╝ ╚═════╝
|
||
|
|
||
4 years ago
|
#[cfg(test)]
|
||
|
mod passing {
|
||
4 years ago
|
use crate::url;
|
||
4 years ago
|
|
||
|
#[test]
|
||
|
fn remove_protocl_and_fragment() {
|
||
|
if cfg!(windows) {
|
||
|
assert_eq!(
|
||
4 years ago
|
url::file_url_to_fs_path("file:///C:/documents/some-path/some-file.svg#fragment"),
|
||
4 years ago
|
"C:\\documents\\some-path\\some-file.svg"
|
||
|
);
|
||
|
} else {
|
||
|
assert_eq!(
|
||
4 years ago
|
url::file_url_to_fs_path("file:///tmp/some-path/some-file.svg#fragment"),
|
||
4 years ago
|
"/tmp/some-path/some-file.svg"
|
||
|
);
|
||
|
}
|
||
5 years ago
|
}
|
||
5 years ago
|
|
||
4 years ago
|
#[test]
|
||
|
fn decodes_urls() {
|
||
|
if cfg!(windows) {
|
||
|
assert_eq!(
|
||
4 years ago
|
url::file_url_to_fs_path("file:///C:/Documents%20and%20Settings/some-file.html"),
|
||
4 years ago
|
"C:\\Documents and Settings\\some-file.html"
|
||
|
);
|
||
|
} else {
|
||
|
assert_eq!(
|
||
4 years ago
|
url::file_url_to_fs_path("file:///home/user/My%20Documents"),
|
||
4 years ago
|
"/home/user/My Documents"
|
||
|
);
|
||
|
}
|
||
5 years ago
|
}
|
||
|
}
|