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.98 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.97 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.96 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.95 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.94 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.93 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.92 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.91 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.90 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.89 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.88 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.87 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.86 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.85 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.84 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.83 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.82 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.81 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.80 tracks/lua/exercises/gigasecond/gigasecond_spec.lua
trackler-2.2.1.79 tracks/lua/exercises/gigasecond/gigasecond_spec.lua