summaryrefslogtreecommitdiff
blob: fe3f7815a04e68d5398523c7857d0f9d51f2aa1a (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--- a/spec/formatters_spec.lua
+++ b/spec/formatters_spec.lua
@@ -102,18 +102,6 @@
     assert.is.equal(expected, formatted)
   end)
 
-  it("Checks to see if TableErrorHighlightColor changes error color", function()
-    local ok, colors = pcall(require, "term.colors")
-    if not ok then pending("lua term.colors not available") end
-
-    assert:set_parameter("TableErrorHighlightColor", "red")
-    local t = {1,2,3}
-    local fmtargs = { {crumbs = {2}} }
-    local formatted = assert:format({t, n = 1, fmtargs = fmtargs})[1]
-    local expected = string.format("("..tostring(t)..") {\n  [1] = 1\n %s[2] = 2\n  [3] = 3 }", colors.red("*"))
-    assert.is.equal(expected, formatted)
-  end)
-
   it("Checks to see if self referencing tables can be formatted", function()
     local t = {1,2}
     t[3] = t
--- a/spec/assertions_spec.lua
+++ b/spec/assertions_spec.lua
@@ -472,17 +472,6 @@
     assert.no_error_matches(t_ok, ".*")
   end)
 
-  it("Checks error_matches compares error strings with pattern", function()
-    assert.error_matches(function() error() end, nil)
-    assert.no_error_matches(function() end, nil)
-    assert.does_error_match(function() error(123) end, "^%d+$")
-    assert.error.matches(function() error("string") end, "^%w+$")
-    assert.matches.error(function() error("string") end, "str", nil, true)
-    assert.matches_error(function() error("123string") end, "^[^0-9]+", 4)
-    assert.has_no_error.match(function() error("123string") end, "123", 4, true)
-    assert.does_not.match_error(function() error("string") end, "^%w+$", nil, true)
-  end)
-
   it("Checks error_matches does not compare error objects", function()
     local func = function() end
     assert.no_error_matches(function() error({ "table" }) end, "table")
@@ -557,15 +546,6 @@
     assert.is_same({}, {assert.has_no_match("%d+", "string", nil, true, "message")})
   end)
 
-  it("Checks assert.has_error returns thrown error on success", function()
-    assert.is_same({"err message", "err message"}, {assert.has_error(function() error("err message") end, "err message")})
-    assert.is_same({"err", "err"}, {assert.has_error(function() error(setmetatable({},{__tostring = function() return "err" end})) end, "err")})
-    assert.is_same({{}, {}}, {assert.has_error(function() error({}) end, {})})
-    assert.is_same({'0', 0}, {assert.has_error(function() error(0) end, 0)})
-    assert.is_same({nil, nil}, {assert.has_error(function() error(nil) end, nil)})
-    assert.is_same({nil, "string"}, {assert.has_no_error(function() end, "string")})
-  end)
-
   it("Checks assert.error_matches returns captures of thrown error on success", function()
     assert.is_same({"err", "message"}, {assert.error_matches(function() error("err message") end, "(err) (%w+)$")})
     assert.is_same({"err"}, {assert.error_matches(function() error(setmetatable({},{__tostring = function() return "err" end})) end, "err", nil, true)})