Skip to content

Commit

Permalink
test: enable clipboard test
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Oct 13, 2024
1 parent 18b08d9 commit ed80f21
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/test_clipboard.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
use crate::workdir::Workdir;
use arboard::Clipboard;

// Assume a user has qsv stats output in their clipboard.
// This test compares the stats output of fruits.csv to the clipboard output.
#[test]
#[ignore = "Requires clipboard to test."]
// #[ignore = "Requires clipboard to test."]
fn clipboard_success() {
let wrk = Workdir::new("stats_clipboard_equality");
let mut clipboard_cmd = wrk.command("clipboard");
let clipboard_output: String = wrk.stdout(&mut clipboard_cmd);

// This test compares the stats output of fruits.csv to the clipboard output.
#[cfg(not(windows))]
let expected = "field,type,is_ascii,sum,min,max,range,min_length,max_length,mean,sem,stddev,\
variance,cv,nullcount,max_precision,sparsity\nfruit,String,true,,apple,\
Expand All @@ -20,5 +18,11 @@ fn clipboard_success() {
strawberry,,5,10,,,,,,0,,0\r\nprice,Float,,7,1.5,3.0,1.5,4,4,2.3333,0.36,0.\
6236,0.3889,26.7261,0,1,0";

let mut clipboard = Clipboard::new().unwrap();
clipboard.set_text(expected).unwrap();

let mut clipboard_cmd = wrk.command("clipboard");
let clipboard_output: String = wrk.stdout(&mut clipboard_cmd);

assert_eq!(clipboard_output, expected);
}

0 comments on commit ed80f21

Please sign in to comment.