2 # Copyright (C) 2001-2010, Parrot Foundation.
7 t/op/time.t - Time and Sleep
12 .include 'test_more.pir'
18 test_sleep_i_negative()
20 test_sleep_n_negative()
27 ok($I2, "Current int time is greater than 0")
31 ok($I2, "Current int time is greater than older time")
37 ok($I0, "Current num time is greater than 0.0")
41 ok($I0, "Current num time is greater than older time")
49 ok($I2, "sleep_i increases time")
52 ok($I3, "sleep_i slept for at least the amount of time specified")
55 .sub test_sleep_i_negative
56 push_eh cannot_sleep_negative
59 ok(0, "Guess what? Just time traveled")
61 cannot_sleep_negative:
63 ok(1, "Cannot sleep_i backwards")
71 ok($I2, "sleep_n increases time")
74 ok($I2, "sleep_n slept for at least the integer amount of time specified")
77 .sub test_sleep_n_negative
78 push_eh cannot_sleep_negative
81 ok(0, "Guess what? Just time traveled")
83 cannot_sleep_negative:
85 ok(1, "Cannot sleep_n backwards")
90 is(.TM_SEC, 0, "TM_SEC ok")
91 is(.TM_MIN, 1, "TM_MIN ok")
92 is(.TM_HOUR, 2, "TM_HOUR ok")
93 is(.TM_MDAY, 3, "TM_MDAY ok")
94 is(.TM_MON, 4, "TM_MON ok")
95 is(.TM_YEAR, 5, "TM_YEAR ok")
96 is(.TM_WDAY, 6, "TM_WDAY ok")
97 is(.TM_YDAY, 7, "TM_YDAY ok")
98 is(.TM_ISDST, 8, "TM_ISDST ok")
105 # vim: expandtab shiftwidth=4 ft=pir: