This commit is contained in:
parent
60d8425470
commit
29cb3fca7a
@ -149,19 +149,6 @@ impl TeraFn for GetUrl {
|
||||
};
|
||||
}
|
||||
|
||||
if cfg!(target_os = "windows") {
|
||||
permalink = match url::Url::parse(&permalink) {
|
||||
Ok(parsed) => parsed.into(),
|
||||
Err(_) => {
|
||||
return Err(format!(
|
||||
"`get_url`: Could not parse link `{}` as a valid URL",
|
||||
permalink
|
||||
)
|
||||
.into())
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Ok(to_value(permalink).unwrap())
|
||||
}
|
||||
}
|
||||
@ -645,27 +632,6 @@ title = "A title"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn can_resolve_asset_path_to_valid_url() {
|
||||
let config = Config::parse(CONFIG_DATA).unwrap();
|
||||
let dir = create_temp_dir();
|
||||
let static_fn =
|
||||
GetUrl::new(dir.path().to_path_buf(), config, HashMap::new(), PathBuf::new());
|
||||
let mut args = HashMap::new();
|
||||
args.insert(
|
||||
"path".to_string(),
|
||||
to_value(dir.path().join("app.css").strip_prefix(std::env::temp_dir()).unwrap())
|
||||
.unwrap(),
|
||||
);
|
||||
assert_eq!(
|
||||
static_fn.call(&args).unwrap(),
|
||||
format!(
|
||||
"https://remplace-par-ton-url.fr/{}/app.css",
|
||||
dir.path().file_stem().unwrap().to_string_lossy()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn error_when_file_not_found_for_hash() {
|
||||
let dir = create_temp_dir();
|
||||
|
Loading…
Reference in New Issue
Block a user