wip: try some stuff
This commit is contained in:
parent
5cd9a539a5
commit
7151e3a7cb
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
default = {
|
||||
-- lua = "tl run",
|
||||
helper = "run-busted.lua",
|
||||
},
|
||||
}
|
|
@ -14,6 +14,9 @@ indent_size = 3
|
|||
[*.{tl,d.tl}]
|
||||
indent_size = 3
|
||||
|
||||
[.busted]
|
||||
indent_size = 3
|
||||
|
||||
[justfile]
|
||||
indent_size = 2
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
],
|
||||
"files.associations": {
|
||||
".luacheckrc": "lua",
|
||||
"*.rockspec": "lua"
|
||||
"*.rockspec": "lua",
|
||||
".busted": "lua"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
rockspec_format = "3.0"
|
||||
package = "awesomewm.d.tl"
|
||||
version = "dev-1"
|
||||
source = {
|
||||
|
@ -18,7 +19,13 @@ dependencies = {
|
|||
"luasec 1.2.0-1",
|
||||
"luafilesystem 1.8.0-1",
|
||||
}
|
||||
test_dependencies = {
|
||||
"busted",
|
||||
}
|
||||
build = {
|
||||
type = "builtin",
|
||||
modules = {},
|
||||
}
|
||||
test = {
|
||||
type = "busted",
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
local tl = require "tl"
|
||||
tl.loader()
|
||||
print "helper"
|
|
@ -0,0 +1,29 @@
|
|||
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!
|
||||
assert.are.same({ table = "great" }, { table = "great" })
|
||||
|
||||
-- or check by reference!
|
||||
assert.are_not.equal({ table = "great" }, { table = "great" })
|
||||
|
||||
assert.truthy "this is a string" -- truthy: not false or nil
|
||||
|
||||
assert.True(1 == 1)
|
||||
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()
|
||||
assert.are.unique { { thing = 1 }, { thing = 2 }, { thing = 3 } }
|
||||
end)
|
||||
end)
|
||||
end)
|
|
@ -0,0 +1,5 @@
|
|||
require "busted.runner"()
|
||||
local tl = require "tl"
|
||||
tl.loader()
|
||||
|
||||
dofile "spec/example_spec.tl"
|
Loading…
Reference in New Issue