| 1 | import clipboard |
| 2 | |
| 3 | fn run_test(is_primary bool) { |
| 4 | mut cb := if is_primary { clipboard.new_primary() } else { clipboard.new() } |
| 5 | if !cb.is_available() { |
| 6 | return |
| 7 | } |
| 8 | assert cb.check_ownership() == false |
| 9 | assert cb.copy('I am a good boy!') == true |
| 10 | // assert cb.check_ownership() == true TODO |
| 11 | assert cb.paste() == 'I am a good boy!' |
| 12 | cb.clear_all() |
| 13 | assert cb.paste().len <= 0 |
| 14 | cb.destroy() |
| 15 | } |
| 16 | |
| 17 | fn test_primary() { |
| 18 | $if linux || freebsd { |
| 19 | // run_test(true) |
| 20 | return |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | fn test_clipboard() { |
| 25 | $if linux || freebsd { |
| 26 | return |
| 27 | } |
| 28 | run_test(false) |
| 29 | } |
| 30 | |