Skip to content

Commit

Permalink
shallow_copy for upgrade test
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Jun 5, 2024
1 parent 2e65fc2 commit 0bed5cc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions spec/helpers/http_mock/nginx_instance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@ local error = error
local assert = assert
local ngx = ngx
local io = io
-- It can't be changed to kong.tools.table because the old version
-- does not have kong/tools/table.lua, so the upgrade test will fail.
local shallow_copy = require("kong.tools.utils").shallow_copy

local shallow_copy
do
local clone = require "table.clone"

shallow_copy = function(orig)
assert(type(orig) == "table")
return clone(orig)
end
end

local template = assert(pl_template.compile(template_str))
local render_env = {ipairs = ipairs, pairs = pairs, error = error, }
Expand Down

0 comments on commit 0bed5cc

Please sign in to comment.