feat: copy selected video URL
This commit is contained in:
@@ -532,6 +532,30 @@ mod subprocesses {
|
||||
assert_reaped(pid);
|
||||
}
|
||||
}
|
||||
#[test]
|
||||
fn video_urls_preserve_provider_identity_and_reject_invalid_keys() {
|
||||
assert_eq!(
|
||||
video_url("jNQXAC9IVRw").unwrap(),
|
||||
"https://www.youtube.com/watch?v=jNQXAC9IVRw"
|
||||
);
|
||||
assert_eq!(
|
||||
video_url("miruro:opaque_ID-7:3").unwrap(),
|
||||
"https://barelystarted.miruro.tv/watch/opaque_ID-7/episode?ep=3"
|
||||
);
|
||||
for id in [
|
||||
"",
|
||||
"--help",
|
||||
"jNQXAC9IVRw&list=other",
|
||||
"miruro:id:0",
|
||||
"miruro:id:03",
|
||||
"miruro:../id:3",
|
||||
] {
|
||||
assert_eq!(
|
||||
video_url(id).unwrap_err().kind(),
|
||||
io::ErrorKind::InvalidInput
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn browser_open_rejects_unsafe_video_ids_before_spawning() {
|
||||
|
||||
Reference in New Issue
Block a user