Sha256: 25e0ca711a4ad427211af09897eefd04e35562873153aa96ecbba88a521a85b6

Contents?: true

Size: 1.22 KB

Versions: 21

Compression:

Stored size: 1.22 KB

Contents

import unittest, times

import gigasecond

suite "Gigasecond":

    test "date only specification of time":
        let birthday = initDateTime(25, mApr, 2011, 0, 0, 0, utc())
        let expected = initDateTime(1, mJan, 2043, 1, 46, 40, utc())
        check add_gigasecond(birthday) == expected

    test "second test for date only specification of time":
        let birthday = initDateTime(13, mJun, 1977, 0, 0, 0, utc())
        let expected = initDateTime(19, mFeb, 2009, 1, 46, 40, utc())
        check add_gigasecond(birthday) == expected

    test "third test for date only specification of time":
        let birthday = initDateTime(19, mJul, 1959, 0, 0, 0, utc())
        let expected = initDateTime(27, mMar, 1991, 1, 46, 40, utc())
        check add_gigasecond(birthday) == expected

    test "full time specified":
        let birthday = initDateTime(24, mJan, 2015, 22, 0, 0, utc())
        let expected = initDateTime(2, mOct, 2046, 23, 46, 40, utc())
        check add_gigasecond(birthday) == expected

    test "full time with day roll-over":
        let birthday = initDateTime(24, mJan, 2015, 23, 59, 59, utc())
        let expected = initDateTime(3, mOct, 2046, 1, 46, 39, utc())
        check add_gigasecond(birthday) == expected


Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.158 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.157 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.156 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.155 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.154 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.153 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.152 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.151 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.150 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.149 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.148 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.147 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.146 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.145 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.144 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.143 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.142 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.141 tracks/nim/exercises/gigasecond/gigasecond_test.nim
trackler-2.2.1.140 tracks/nim/exercises/gigasecond/gigasecond_test.nim