forked from alacritty/copypasta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for ClipboardContext and NopClipboardContext
copypasta doesn't seem to have unit tests, so I accidentally made changes with the PR: alacritty#57 I want to make sure any changes are checked by running test codes. That's why I want to add test codes.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use copypasta::{ClipboardContext, ClipboardProvider}; | ||
|
||
#[test] | ||
fn it_works() { | ||
let mut ctx = ClipboardContext::new().unwrap(); | ||
let msg = "Hello, world!"; | ||
|
||
ctx.set_contents(msg.to_owned()).unwrap(); | ||
assert_eq!(ctx.get_contents().unwrap(), "Hello, world!"); | ||
} |