Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 22 lines (20 sloc) 0.444 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
local pcall, error = pcall, error

local lunit = require("lunit")
local assert_error = lunit.assert_error

-- Allow module to alter decoder
local function setDecoder(d)
decode = d
end
module("testutil", package.seeall)
function buildPatchedDecoder(f, newDecoder)
return function()
setDecoder(newDecoder)
f()
end
end
function buildFailedPatchedDecoder(f, newDecoder)
return function()
setDecoder(newDecoder)
assert_error(f)
end
end
Something went wrong with that request. Please try again.