summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-02-08 22:31:47 +0100
committerAki <please@ignore.pl>2024-02-08 22:35:46 +0100
commit2b961ff5c3058b477e1ead61d8fa139f126509fd (patch)
tree1191780309675195806c9d63446ab10f8314220a /spec
parent89b7fc43530535ea0fb2114e5fa0cf5660ca37a0 (diff)
downloadactivity-2b961ff5c3058b477e1ead61d8fa139f126509fd.zip
activity-2b961ff5c3058b477e1ead61d8fa139f126509fd.tar.gz
activity-2b961ff5c3058b477e1ead61d8fa139f126509fd.tar.bz2
Generate empty rolling table
Diffstat (limited to 'spec')
-rw-r--r--spec/activity_spec.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/activity_spec.lua b/spec/activity_spec.lua
index 197b57f..581b0ba 100644
--- a/spec/activity_spec.lua
+++ b/spec/activity_spec.lua
@@ -32,6 +32,16 @@ Fri 0000000000000000000000000000000000000000000000000000_
0000000000000000000000000000000000000000000000000000_
]]
+local ROLL = [[
+ 00000000000000000000000000000000000000000000000000000
+Mon 00000000000000000000000000000000000000000000000000000
+ 00000000000000000000000000000000000000000000000000000
+Wed 00000000000000000000000000000000000000000000000000000
+ 00000000000000000000000000000000000000000000000000000
+Fri 0000000000000000000000000000000000000000000000000000_
+ 0000000000000000000000000000000000000000000000000000_
+]]
+
describe("Generator", function()
describe("shall generate correct table for year", function()
@@ -66,4 +76,9 @@ describe("Generator", function()
assert.are.equal(Y2024:gsub("0", "1"), activity.generate_table(2024, lookup, plain))
end)
end)
+
+ it("shall support generating rolling table", function()
+ local date = os.date("*t", os.time{year=2024, month=2, day=8})
+ assert.are.equal(ROLL, activity.generate_table("rolling", lookup, plain, date))
+ end)
end)