Update test.
This commit is contained in:
parent
042a7f4a60
commit
08dd077511
@ -57,6 +57,12 @@ function test_04()
|
|||||||
assert_match('Content%-Type: text/plain\r\n', data)
|
assert_match('Content%-Type: text/plain\r\n', data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_error()
|
||||||
|
assert_error(function() post:add_content() end)
|
||||||
|
assert_error(function() post:add_stream(nil) end)
|
||||||
|
assert_error(function() post:add_stream('name01') end)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local _ENV = TEST_CASE'add_buffer' do
|
local _ENV = TEST_CASE'add_buffer' do
|
||||||
@ -122,6 +128,15 @@ function test_05()
|
|||||||
assert_match('Content%-Encoding: gzip\r\n', data)
|
assert_match('Content%-Encoding: gzip\r\n', data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_error()
|
||||||
|
assert_error(function() post:add_buffer() end)
|
||||||
|
assert_error(function() post:add_buffer(nil) end)
|
||||||
|
assert_error(function() post:add_buffer('name01') end)
|
||||||
|
assert_error(function() post:add_buffer('name02', 'file02') end)
|
||||||
|
assert_error(function() post:add_buffer('name03', 'file03', nil) end)
|
||||||
|
assert_error(function() post:add_buffer('name04', nil, 'value04') end)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local _ENV = TEST_CASE'add_stream' do
|
local _ENV = TEST_CASE'add_stream' do
|
||||||
@ -208,6 +223,12 @@ function test_09()
|
|||||||
assert_match('name="name09"', data)
|
assert_match('name="name09"', data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_error()
|
||||||
|
assert_error(function() post:add_stream('name01', dummy) end)
|
||||||
|
assert_error(function() post:add_stream('name02', 10) end)
|
||||||
|
assert_error(function() post:add_stream('name03', "10", dummy) end)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if not HAS_RUNNER then lunit.run() end
|
if not HAS_RUNNER then lunit.run() end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user