Update test.

This commit is contained in:
Alexey Melnichuk 2014-09-04 15:15:31 +05:00
parent 042a7f4a60
commit 08dd077511

View File

@ -57,6 +57,12 @@ function test_04()
assert_match('Content%-Type: text/plain\r\n', data)
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
local _ENV = TEST_CASE'add_buffer' do
@ -122,6 +128,15 @@ function test_05()
assert_match('Content%-Encoding: gzip\r\n', data)
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
local _ENV = TEST_CASE'add_stream' do
@ -208,6 +223,12 @@ function test_09()
assert_match('name="name09"', data)
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
if not HAS_RUNNER then lunit.run() end