summaryrefslogtreecommitdiffstats
path: root/tests-perf/clock.perf.tcl
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2017-01-10 23:02:02 (GMT)
committersebres <sebres@users.sourceforge.net>2017-01-10 23:02:02 (GMT)
commit77a54daa546c50756c2734f86b9e230f02bcc676 (patch)
tree797ec4ebde45a5be9332c0046013aadd9652e431 /tests-perf/clock.perf.tcl
parenta46b1f79d3095b4e867148fee2cb94dfe84fab44 (diff)
downloadtcl-77a54daa546c50756c2734f86b9e230f02bcc676.zip
tcl-77a54daa546c50756c2734f86b9e230f02bcc676.tar.gz
tcl-77a54daa546c50756c2734f86b9e230f02bcc676.tar.bz2
"clock add" rewritten in C, using common functionality of "clock scan" (and freescan)...
test-performance.tcl: test cases extended to cover "clock add"
Diffstat (limited to 'tests-perf/clock.perf.tcl')
-rw-r--r--tests-perf/clock.perf.tcl39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests-perf/clock.perf.tcl b/tests-perf/clock.perf.tcl
index 16664b2..733db1a 100644
--- a/tests-perf/clock.perf.tcl
+++ b/tests-perf/clock.perf.tcl
@@ -318,6 +318,44 @@ proc test-freescan {{reptime 1000}} {
} {puts [clock format $_(r) -locale en]}
}
+proc test-add {{reptime 1000}} {
+ _test_run $reptime {
+ # Add : years
+ {clock add 1246379415 5 years -gmt 1}
+ # Add : months
+ {clock add 1246379415 18 months -gmt 1}
+ # Add : weeks
+ {clock add 1246379415 20 weeks -gmt 1}
+ # Add : days
+ {clock add 1246379415 385 days -gmt 1}
+ # Add : weekdays
+ {clock add 1246379415 3 weekdays -gmt 1}
+
+ # Add : hours
+ {clock add 1246379415 5 hours -gmt 1}
+ # Add : minutes
+ {clock add 1246379415 55 minutes -gmt 1}
+ # Add : seconds
+ {clock add 1246379415 100 seconds -gmt 1}
+
+ # Add : +/- in gmt
+ {clock add 1246379415 -5 years +21 months -20 weeks +386 days -19 hours +30 minutes -10 seconds -gmt 1}
+ # Add : +/- in system timezone
+ {clock add 1246379415 -5 years +21 months -20 weeks +386 days -19 hours +30 minutes -10 seconds -timezone :CET}
+
+ # Add : gmt
+ {clock add 1246379415 -5 years 18 months 366 days 5 hours 30 minutes 10 seconds -gmt 1}
+ # Add : system timezone
+ {clock add 1246379415 -5 years 18 months 366 days 5 hours 30 minutes 10 seconds -timezone :CET}
+
+ # Add : all in gmt
+ {clock add 1246379415 4 years 18 months 50 weeks 378 days 3 weekdays 5 hours 30 minutes 10 seconds -gmt 1}
+ # Add : all in system timezone
+ {clock add 1246379415 4 years 18 months 50 weeks 378 days 3 weekdays 5 hours 30 minutes 10 seconds -timezone :CET}
+
+ } {puts [clock format $_(r) -locale en]}
+}
+
proc test-other {{reptime 1000}} {
_test_run $reptime {
# Bad zone
@@ -338,6 +376,7 @@ proc test {{reptime 1000}} {
test-format $reptime
test-scan $reptime
test-freescan $reptime
+ test-add $reptime
test-other $reptime
puts \n**OK**