diff options
author | Aki <please@ignore.pl> | 2024-02-07 22:21:19 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-02-07 22:48:20 +0100 |
commit | 85f53fed3026366c3970e26e2843be3d8e702c20 (patch) | |
tree | f3f656c1557f9ffd4855feb90aafe5f6676e4eee /spec/activity_spec.lua | |
parent | 16c1d512c91cd91d0f3a81cc451a7add636370e0 (diff) | |
download | activity-85f53fed3026366c3970e26e2843be3d8e702c20.zip activity-85f53fed3026366c3970e26e2843be3d8e702c20.tar.gz activity-85f53fed3026366c3970e26e2843be3d8e702c20.tar.bz2 |
Added plain format
It is intended mostly for testing purposes
Diffstat (limited to 'spec/activity_spec.lua')
-rw-r--r-- | spec/activity_spec.lua | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/activity_spec.lua b/spec/activity_spec.lua new file mode 100644 index 0000000..634a228 --- /dev/null +++ b/spec/activity_spec.lua @@ -0,0 +1,49 @@ +local activity = require "activity" +local plain = require "activity.formats.plain" + +local Y2024 = [[ + _0000000000000000000000000000000000000000000000000000 +Mon 00000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000 +Wed 0000000000000000000000000000000000000000000000000000_ + 0000000000000000000000000000000000000000000000000000_ +Fri 0000000000000000000000000000000000000000000000000000_ + 0000000000000000000000000000000000000000000000000000_ +]] + +local Y2023 = [[ + 00000000000000000000000000000000000000000000000000000 +Mon 0000000000000000000000000000000000000000000000000000_ + 0000000000000000000000000000000000000000000000000000_ +Wed 0000000000000000000000000000000000000000000000000000_ + 0000000000000000000000000000000000000000000000000000_ +Fri 0000000000000000000000000000000000000000000000000000_ + 0000000000000000000000000000000000000000000000000000_ +]] + +local Y2020 = [[ + _0000000000000000000000000000000000000000000000000000 +Mon _0000000000000000000000000000000000000000000000000000 + _0000000000000000000000000000000000000000000000000000 +Wed 00000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000 +Fri 0000000000000000000000000000000000000000000000000000_ + 0000000000000000000000000000000000000000000000000000_ +]] + + +describe("Generator", function() + describe("shall generate correct table for year", function() + it("2024", function() + assert.are.equal(Y2024, activity.generate_table(2024, {}, plain)) + end) + + it("2023", function() + assert.are.equal(Y2023, activity.generate_table(2023, {}, plain)) + end) + + it("2020", function() + assert.are.equal(Y2020, activity.generate_table(2020, {}, plain)) + end) + end) +end) |