aboutsummaryrefslogtreecommitdiff
path: root/challenge-099/tyler-wardhaugh/lua/test.lua
diff options
context:
space:
mode:
authorTyler Wardhaugh <tyler.wardhaugh@gmail.com>2021-02-10 17:11:53 -0800
committerTyler Wardhaugh <tyler.wardhaugh@gmail.com>2021-02-12 09:31:25 -0800
commitbd2c088a7fcdc46926aaa3d428714b3850a3a154 (patch)
tree0a5fdaa23c0a17d791a69567b19d7d650888f28a /challenge-099/tyler-wardhaugh/lua/test.lua
parentdc48cb570de7841f7af41ba6e81ef64007c8059e (diff)
downloadperlweeklychallenge-club-bd2c088a7fcdc46926aaa3d428714b3850a3a154.tar.gz
perlweeklychallenge-club-bd2c088a7fcdc46926aaa3d428714b3850a3a154.tar.bz2
perlweeklychallenge-club-bd2c088a7fcdc46926aaa3d428714b3850a3a154.zip
Ch99 (Lua): Tasks 1 & 2
Diffstat (limited to 'challenge-099/tyler-wardhaugh/lua/test.lua')
-rwxr-xr-xchallenge-099/tyler-wardhaugh/lua/test.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/challenge-099/tyler-wardhaugh/lua/test.lua b/challenge-099/tyler-wardhaugh/lua/test.lua
new file mode 100755
index 0000000000..997d732f23
--- /dev/null
+++ b/challenge-099/tyler-wardhaugh/lua/test.lua
@@ -0,0 +1,22 @@
+#!/usr/bin/env lua
+
+require 'busted.runner'()
+
+describe("Task 1, Pattern Match", function()
+ local t1 = require'ch-1'
+ it("produces correct results for the examples", function()
+ assert.are.truthy(t1.pattern_match("abcde", "a*e"))
+ assert.are.falsy(t1.pattern_match("abcde", "a*d"))
+ assert.are.falsy(t1.pattern_match("abcde", "?b*d"))
+ assert.are.truthy(t1.pattern_match("abcde", "a*c?e"))
+ end)
+end)
+
+
+describe("Task 2, Unique Subsequences", function()
+ local t2 = require'ch-2'
+ it("produces correct results for the examples", function()
+ assert.are.same(5, t2.unique_subsequences("littleit", "lit"))
+ assert.are.same(3, t2.unique_subsequences("london", "lon"))
+ end)
+end)