blob: 997d732f23ecfb894a49f9d37dff065c227e82eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)
|