Sha256: ac240b80fa6d899a381a020db9754aea3715ee5b47f8f83cbf04faa28bac9bb8

Contents?: true

Size: 1.15 KB

Versions: 396

Compression:

Stored size: 1.15 KB

Contents

local gigasecond = require('gigasecond')

describe('gigasecond', function()
  it('test 1', function()
    local actual = gigasecond.anniversary(os.time({ year = 2011, month = 3, day = 25, hour = 0, min = 0, sec = 0 }))
    local expectedDate = os.date('%x', os.time({ year = 2042, month = 12, day = 1, hour = 0, min = 0, sec = 0 }))
    assert.are.equals(expectedDate, actual)
  end)

  it('test 2', function()
    local actual = gigasecond.anniversary(os.time({ year = 1977, month = 5, day = 13, hour = 0, min = 0, sec = 0 }))
    local expectedDate = os.date('%x', os.time({ year = 2009, month = 1, day = 19 }))
    assert.are.equals(expectedDate, actual)
  end)

  it('test 3', function()
    local actual = gigasecond.anniversary(os.time({ year = 1959, month = 7, day = 19 }))
    local expectedDate = os.date('%x', os.time({ year = 1991, month = 3, day = 27 }))
    assert.are.equals(expectedDate, actual)
  end)

  it('test 4', function()
    local actual = gigasecond.anniversary(os.time({ year = 1993, month = 8, day = 17 }))
    local expectedDate = os.date('%x', os.time({ year = 2025, month = 4, day = 25 }))
    assert.are.equals(expectedDate, actual)
  end)
end)

Version data entries

396 entries across 396 versions & 1 rubygems

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