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

Version Path
trackler-2.2.1.180 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.179 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.178 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.177 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.176 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.175 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.174 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.173 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.172 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.171 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.170 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.169 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.167 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.166 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.165 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.164 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.163 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.162 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.161 tracks/racket/exercises/gigasecond/gigasecond-test.rkt
trackler-2.2.1.160 tracks/racket/exercises/gigasecond/gigasecond-test.rkt