Skip to content

Commit

Permalink
tests(tools): test against read-only table returned by `kong.tools.ht…
Browse files Browse the repository at this point in the history
…tp.parse_directive_header()`
  • Loading branch information
ADD-SP committed Aug 12, 2024
1 parent c272b1b commit 4fce3b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/01-unit/05-utils_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ describe("Utils", function()
end)

it("test parsing directive header", function()
-- EMPTY table return by the function with `nil` should be read-only
assert.is_false(pcall(function()
tools_http.parse_directive_header(nil)["foo"] = "bar"
end))

-- test null
assert.same(tools_http.parse_directive_header(nil), {})

Expand Down

0 comments on commit 4fce3b3

Please sign in to comment.