Sha256: f3b037cd36da74aa6c30e6ac04bf0c121a6bc70f6619784c5b382cd4b4c77b1e
Contents?: true
Size: 1.14 KB
Versions: 396
Compression:
Stored size: 1.14 KB
Contents
#lang racket (require "gigasecond.rkt") (module+ test (require rackunit rackunit/text-ui racket/date)) (module+ test (define (make-datetime year month day hour minute second) (seconds->date (find-seconds second minute hour day month year #f))) (define suite (test-suite "Tests for the gigasecond exercise" (test-equal? "test 2011 04 25" (add-gigasecond (make-datetime 2011 4 25 0 0 0)) (make-datetime 2043 1 1 1 46 40)) (test-equal? "test 1977 06 13" (add-gigasecond (make-datetime 1977 6 13 0 0 0)) (make-datetime 2009 2 19 1 46 40)) (test-equal? "test 1959 07 19" (add-gigasecond (make-datetime 1959 7 19 0 0 0)) (make-datetime 1991 3 27 1 46 40)) (test-equal? "test full time specified" (add-gigasecond (make-datetime 2015 1 24 22 0 0)) (make-datetime 2046 10 2 23 46 40)) (test-equal? "test full time with day roll over" (add-gigasecond (make-datetime 2015 1 24 23 59 59)) (make-datetime 2046 10 3 1 46 39)))) (run-tests suite))
Version data entries
396 entries across 396 versions & 1 rubygems