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.139 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.138 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.137 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.136 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.135 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.134 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.133 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.132 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.131 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.130 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.129 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.128 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.127 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.126 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.125 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.124 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.123 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.122 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.121 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.120 tracks/lua/exercises/gigasecond/gigasecond_spec.lua