Skip to content

Commit c5e4734

Browse files
committed
Update test.
1 parent 78a4a03 commit c5e4734

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/test_easy.lua

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,4 +998,38 @@ end
998998

999999
end
10001000

1001+
local _ENV = TEST_CASE'multi_add_remove' if ENABLE then
1002+
1003+
local m, c
1004+
1005+
function setup()
1006+
m = assert(scurl.multi())
1007+
end
1008+
1009+
function teardown()
1010+
if c then c:close() end
1011+
if m then m:close() end
1012+
m, c = nil
1013+
end
1014+
1015+
function test_remove_unknow_easy()
1016+
c = assert(scurl.easy())
1017+
assert_equal(m, m:remove_handle(c))
1018+
end
1019+
1020+
function test_double_remove_easy()
1021+
c = assert(scurl.easy())
1022+
assert_equal(m, m:add_handle(c))
1023+
assert_equal(m, m:remove_handle(c))
1024+
assert_equal(m, m:remove_handle(c))
1025+
end
1026+
1027+
function test_double_add_easy()
1028+
c = assert(scurl.easy())
1029+
assert_equal(m, m:add_handle(c))
1030+
assert_nil(m:add_handle(c))
1031+
end
1032+
1033+
end
1034+
10011035
RUN()

0 commit comments

Comments
 (0)