-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathExample.lua
More file actions
41 lines (31 loc) · 927 Bytes
/
Example.lua
File metadata and controls
41 lines (31 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function testCodeaUnitFunctionality()
CodeaUnit.detailed = true
_:describe("CodeaUnit Test Suite", function()
_:before(function()
-- Some setup
end)
_:after(function()
-- Some teardown
end)
_:test("Equality test", function()
_:expect("Foo").is("Foo")
end)
_:test("Negation test", function()
_:expect("Bar").isnt("Foo")
end)
_:test("Containment test", function()
_:expect({"Foo", "Bar", "Baz"}).has("Foo")
end)
_:test("Thrown test", function()
_:expect(function()
error("Foo error")
end).throws("Foo error")
end)
_:ignore("Ignored test", function()
_:expect("Foo").is("Foo")
end)
_:test("Failing test", function()
_:expect("Foo").is("Bar")
end)
end)
end