;;;; srfi-174-srfi-19-test.scm -*- Scheme -*- ;;;; Kon Lovett, Aug '23 ;;;; ;;;; (from SRFI 174 sample implementation srfi-174-chibi-tests.scm) (import (scheme base)) (import test) (import (srfi-174 srfi-19)) (include-relative "srfi-174-test-body") (import srfi-19-time) (import (only (chicken port) with-output-to-string)) (test-group "srfi-174 Extensions" (define ts1 (timespec 1 2)) (let ((t1 (timespec->time ts1))) (test-assert "timespec->time" t1) (test "timespec->time second" (timespec-seconds ts1) (time-second t1)) (test "timespec->time nanosecond" (timespec-nanoseconds ts1) (time-nanosecond t1)) ;check a copy (set-time-second! t1 -1) (test "timespec->time is a copy" (timespec-seconds ts1) (time-second (timespec->time ts1))) ) (test "timespec-print" "#" (with-output-to-string (cut timespec-print ts1))) ) (test-exit)