diff options
author | Kevin Walzer <kw@codebykevin.com> | 2020-10-21 17:41:52 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2020-10-21 17:41:52 (GMT) |
commit | ac65410b59d0e9ee214193831dac37911c713ac7 (patch) | |
tree | f4eee167fe0cc8c919f88468ac5195e81f731df4 /tests | |
parent | 60185fa162e07e3ffb2351e26b1946570633487a (diff) | |
download | tk-ac65410b59d0e9ee214193831dac37911c713ac7.zip tk-ac65410b59d0e9ee214193831dac37911c713ac7.tar.gz tk-ac65410b59d0e9ee214193831dac37911c713ac7.tar.bz2 |
Merge trunk; initial try at test suite addition for systray
Diffstat (limited to 'tests')
-rw-r--r-- | tests/systray.test | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/systray.test b/tests/systray.test new file mode 100644 index 0000000..38f2c24 --- /dev/null +++ b/tests/systray.test @@ -0,0 +1,34 @@ +# If you save this source as, for example, "my_first.test", then execute +# "tclsh my_first.test", the output will be something like +# "==== intro-2 This illustrates how something goes wrong. FAILED +# ==== Contents of test case: + +# expr 3 * 5 + +# ---- Result was: +# 15 +# ---- Result should have been (exact matching): +# 16 +# ==== intro-2 FAILED" + package require tcltest 2.0 + namespace import ::tcltest::* + + test systray-1 {Create a systray icon.} { + image create photo _book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw== + tk systray create _book "Systray sample" {puts "button 1 click"} {puts "button 3 click""} + } {} + + test systray-2 {Argument checking.} { + tk systray create + } error "wrong # args: should be \"tk systray create image ?text? ?b1_callback? b3_callback?" + + + test sysnotify-1 {System notification dialog.} { + tk sysnotify {Alert} {This is an alert} + } {} + + + # To see test statistics (Total/Passed/Skipped/Failed), best putthis line in the end: + tk systray destroy + image delete _book + cleanupTests |