2004-07-07 09:37:56 -04:00
|
|
|
;;; "Test" for the functions in section 3.10 of the scsh manual "time"
|
|
|
|
;;; "Test", because these are no real test - they just call the prozedures to check if they are implemented
|
|
|
|
;;; Author: Christoph Hetz
|
|
|
|
|
|
|
|
;; ,open define-record-types handle
|
|
|
|
;; ,config ,load C:/cygwin/home/mephisto/cvs_scsh/scsh/scsh/test/test-packages.scm
|
|
|
|
;; ,load C:/cygwin/home/mephisto/cvs_scsh/scsh/scsh/test/test-base.scm
|
|
|
|
;; load this file
|
|
|
|
;; (test-all)
|
|
|
|
|
|
|
|
|
|
|
|
;; *** tests ***
|
|
|
|
|
|
|
|
(add-test! 'time-ticks 'time
|
2004-10-03 07:35:21 -04:00
|
|
|
(lambda ()
|
|
|
|
(call-with-values
|
|
|
|
(lambda ()
|
|
|
|
(time+ticks))
|
|
|
|
(lambda (tme tcks)
|
|
|
|
(and (number? tme)
|
|
|
|
(number? tcks))))))
|
2004-07-07 09:37:56 -04:00
|
|
|
|
|
|
|
(add-test! 'ticks/sec 'time
|
2004-10-03 07:35:21 -04:00
|
|
|
(lambda ()
|
|
|
|
(real? (ticks/sec))))
|
2004-07-07 09:37:56 -04:00
|
|
|
|
|
|
|
(add-test! 'date 'time
|
2004-10-03 07:35:21 -04:00
|
|
|
(lambda ()
|
|
|
|
(date? (date))))
|
2004-07-07 09:37:56 -04:00
|
|
|
|
|
|
|
(add-test! 'time 'time
|
2004-10-03 07:35:21 -04:00
|
|
|
(lambda ()
|
|
|
|
(integer? (time))))
|
2004-07-07 09:37:56 -04:00
|
|
|
|
|
|
|
(add-test! 'date->string 'time
|
2004-10-03 07:35:21 -04:00
|
|
|
(lambda ()
|
|
|
|
(string? (date->string (date)))))
|
2004-07-07 09:37:56 -04:00
|
|
|
|
|
|
|
(add-test! 'format-date 'time
|
2004-10-03 07:35:21 -04:00
|
|
|
(lambda ()
|
|
|
|
(string? (format-date "~a ~A ~b ~B ~c ~d ~H ~I ~j ~m ~M ~p ~S ~U ~w ~W ~x ~X ~y ~Y ~Z"
|
|
|
|
(date)))))
|
2004-07-07 09:37:56 -04:00
|
|
|
|
2004-10-03 07:35:21 -04:00
|
|
|
;;; fill-in-date! is not implemented yet.
|
2004-07-07 09:37:56 -04:00
|
|
|
;(add-test! 'fill-in-date! 'time
|
|
|
|
; (lambda ()
|
|
|
|
; (date? (fill-in-date! (date)))))
|