From 2b961ff5c3058b477e1ead61d8fa139f126509fd Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 8 Feb 2024 22:31:47 +0100 Subject: Generate empty rolling table --- spec/activity_spec.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'spec') 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) -- cgit v1.1