awesomewm.d.tl/spec/example_spec.tl

31 lines
872 B
Plaintext
Raw Normal View History

2023-04-17 00:05:15 +02:00
local assert = require("luassert")
2022-10-30 15:11:14 +01:00
describe("Busted unit testing framework", function()
describe("should be awesome", function()
it("should be easy to use", function()
assert.truthy "Yup."
end)
it("should have lots of features", function()
-- deep check comparisons!
2023-04-17 00:05:15 +02:00
assert.same({ table = "great" }, { table = "great" })
2022-10-30 15:11:14 +01:00
-- or check by reference!
2023-04-17 00:05:15 +02:00
assert.not_equal({ table = "great" }, { table = "great" })
2022-10-30 15:11:14 +01:00
assert.truthy "this is a string" -- truthy: not false or nil
assert.is_true(1 == 1)
assert.falsy(nil)
assert.has_error(function()
error "Wat"
end, "Wat")
end)
it("should provide some shortcuts to common functions", function()
2023-04-17 00:05:15 +02:00
assert.is_unique { { thing = 1 }, { thing = 2 }, { thing = 3 } }
2022-10-30 15:11:14 +01:00
end)
end)
end)