diff options
| author | William Boman <william@redwill.se> | 2022-07-06 19:41:43 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2022-07-07 00:39:59 +0200 |
| commit | 5f634e0c37e723fc0c33e06b4fd5c2180178db40 (patch) | |
| tree | fa4f09363adefa8259e23e4d1ea036db628b1243 /tests/helpers/lua/luassertx.lua | |
| parent | feat(health): use stderr for java version, also check for JAVA_HOME (#765) (diff) | |
| download | mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.gz mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.bz2 mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.lz mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.xz mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.zst mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.zip | |
mason.nvim
Diffstat (limited to 'tests/helpers/lua/luassertx.lua')
| -rw-r--r-- | tests/helpers/lua/luassertx.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/helpers/lua/luassertx.lua b/tests/helpers/lua/luassertx.lua index 06d08ede..f4c9e702 100644 --- a/tests/helpers/lua/luassertx.lua +++ b/tests/helpers/lua/luassertx.lua @@ -1,6 +1,6 @@ local assert = require "luassert" local match = require "luassert.match" -local a = require "nvim-lsp-installer.core.async" +local a = require "mason.core.async" local function wait_for(_, arguments) ---@type fun() @Function to execute until it does not error. @@ -57,6 +57,14 @@ local function list_containing(_, arguments, _) end end +local function instanceof(_, arguments, _) + return function(value) + local expected_mt = arguments[1] + return getmetatable(value) == expected_mt + end +end + assert:register("matcher", "tbl_containing", tbl_containing) assert:register("matcher", "list_containing", list_containing) +assert:register("matcher", "instanceof", instanceof) assert:register("assertion", "wait_for", wait_for) |
