aboutsummaryrefslogtreecommitdiff
path: root/challenge-078/tyler-wardhaugh/lua/test.lua
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-078/tyler-wardhaugh/lua/test.lua')
-rwxr-xr-xchallenge-078/tyler-wardhaugh/lua/test.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-078/tyler-wardhaugh/lua/test.lua b/challenge-078/tyler-wardhaugh/lua/test.lua
index d47309f705..c5494095c0 100755
--- a/challenge-078/tyler-wardhaugh/lua/test.lua
+++ b/challenge-078/tyler-wardhaugh/lua/test.lua
@@ -9,3 +9,17 @@ describe("Task 1, Leader Elements", function()
assert.are.same({5}, t1.leaders({3, 4, 5}))
end)
end)
+
+describe("Task 2, Left Rotation", function()
+ local t2 = require'ch-2'
+ it("produces correct results for the examples", function()
+ assert.are.same(
+ {{40, 50, 10, 20, 30}, {50, 10, 20, 30, 40}},
+ t2.multi_rotate({10, 20, 30, 40, 50}, {3, 4})
+ )
+ assert.are.same(
+ {{4, 2, 6, 3, 7}, {6, 3, 7, 4, 2}, {3, 7, 4, 2, 6}},
+ t2.multi_rotate({7, 4, 2, 6, 3}, {1, 3, 4})
+ )
+ end)
+end)