/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/lua/throw_exception_runme.lua
20 строк
966 B
Erez Geva
Improve Lua test syntax (#3463)
02 июн 2026, 01:23
Не верифицирован
02 июн 2026, 01:23
d483ae4
Код
Авторство
О чём код?
local v=require("throw_exception") function testException(func, except) local ret, msg = pcall(func) assert(not ret and msg == except) end local foo = v.Foo() testException(function() foo:test_int() end, 37) testException(function() foo:test_msg() end, "Dead") testException(function() foo:test_multi(1) end, 37) testException(function() foo:test_multi(2) end, "Dead") testException(function() foo:test_cls() end, "object exception:CError") testException(function() foo:test_cls_ptr() end, "object exception:CError *") testException(function() foo:test_cls_ref() end, "object exception:CError *") testException(function() foo:test_cls_td() end, "object exception:CError") testException(function() foo:test_cls_ptr_td() end, "object exception:CError *") testException(function() foo:test_cls_ref_td() end, "object exception:CError *") testException(function() foo:test_array() end, "object exception:int *") testException(function() foo:test_enum() end, 1)