aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-06-03 19:04:52 +0200
committerGitHub <noreply@github.com>2022-06-03 19:04:52 +0200
commitf5f6538984b5bc9bccfc544960e05d47304f3c5e (patch)
tree9f1f0fcd3b35a7ace0efc9966b652bb9b8234121 /tests
parentadded wgsl_analyzer server (#719) (diff)
downloadmason-f5f6538984b5bc9bccfc544960e05d47304f3c5e.tar
mason-f5f6538984b5bc9bccfc544960e05d47304f3c5e.tar.gz
mason-f5f6538984b5bc9bccfc544960e05d47304f3c5e.tar.bz2
mason-f5f6538984b5bc9bccfc544960e05d47304f3c5e.tar.lz
mason-f5f6538984b5bc9bccfc544960e05d47304f3c5e.tar.xz
mason-f5f6538984b5bc9bccfc544960e05d47304f3c5e.tar.zst
mason-f5f6538984b5bc9bccfc544960e05d47304f3c5e.zip
feat: add apex_ls (#746)
Closes #701.
Diffstat (limited to 'tests')
-rw-r--r--tests/core/functional/list_spec.lua9
-rw-r--r--tests/core/functional/string_spec.lua4
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/core/functional/list_spec.lua b/tests/core/functional/list_spec.lua
index 9ab7be6f..21aa4e69 100644
--- a/tests/core/functional/list_spec.lua
+++ b/tests/core/functional/list_spec.lua
@@ -113,4 +113,13 @@ describe("functional: list", function()
assert.is_nil(_.nth(0, { "value" }))
assert.equals("", _.nth(0, "abc"))
end)
+
+ it("should get length", function()
+ assert.equals(0, _.length {})
+ assert.equals(0, _.length { nil })
+ assert.equals(0, _.length { obj = "doesnt count" })
+ assert.equals(0, _.length "")
+ assert.equals(1, _.length { "" })
+ assert.equals(4, _.length "fire")
+ end)
end)
diff --git a/tests/core/functional/string_spec.lua b/tests/core/functional/string_spec.lua
index e24819d9..cbee0617 100644
--- a/tests/core/functional/string_spec.lua
+++ b/tests/core/functional/string_spec.lua
@@ -19,4 +19,8 @@ describe("functional: string", function()
assert.same({ "This", "is", "a", "sentence" }, _.split("%s", "This is a sentence"))
assert.same({ "This", "is", "a", "sentence" }, _.split("|", "This|is|a|sentence"))
end)
+
+ it("should gsub strings", function()
+ assert.same("predator", _.gsub("^apex%s*", "", "apex predator"))
+ end)
end)