diff --git a/examples/set_html.rs b/examples/set_get_html.rs similarity index 78% rename from examples/set_html.rs rename to examples/set_get_html.rs index 125f6b1..a88c27f 100644 --- a/examples/set_html.rs +++ b/examples/set_get_html.rs @@ -15,4 +15,7 @@ consectetur adipiscing elit."#; ctx.set_html(html, Some(alt_text)).unwrap(); thread::sleep(Duration::from_secs(5)); + + let success = ctx.get().html().unwrap() == html; + println!("Set and Get html operation were successful: {success}"); } diff --git a/src/lib.rs b/src/lib.rs index 81d4f51..eb3c1bd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -327,6 +327,15 @@ mod tests { ctx.set_html(html, Some(alt_text)).unwrap(); assert_eq!(ctx.get_text().unwrap(), alt_text); } + { + let mut ctx = Clipboard::new().unwrap(); + + let html = "hello world!"; + + ctx.set().html(html, None).unwrap(); + + assert_eq!(ctx.get().html().unwrap(), html); + } #[cfg(feature = "image-data")] { let mut ctx = Clipboard::new().unwrap();