12 lines
642 B
Rust
12 lines
642 B
Rust
#[test]
|
|
fn reads_copied_files_from_clipboard() {
|
|
if std::env::var_os("WAYLAND_DISPLAY").is_none() || std::process::Command::new("wl-copy").arg("--version").output().is_err() {
|
|
return;
|
|
}
|
|
let mut c = std::process::Command::new("wl-copy").args(["-t", "text/uri-list"]).stdin(std::process::Stdio::piped()).spawn().unwrap();
|
|
use std::io::Write;
|
|
c.stdin.take().unwrap().write_all(b"file:///tmp/a%20b.flac\r\nfile:///tmp/c.opus\r\n").unwrap();
|
|
c.wait().unwrap();
|
|
std::thread::sleep(std::time::Duration::from_millis(200));
|
|
assert_eq!(mulberry::util::clipboard_files(), vec!["/tmp/a b.flac", "/tmp/c.opus"]);
|
|
}
|