/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/lua/swig_exception_runme.lua
15 строк
445 B
Erez Geva
Improve Lua test syntax (#3463)
02 июн 2026, 01:23
Не верифицирован
02 июн 2026, 01:23
d483ae4
Код
Авторство
О чём код?
local v=require("swig_exception") local c = v.Circle(10) local s = v.Square(10) assert(v.Shape.nshapes == 2, "Shape.nshapes should be 2 not " .. v.Shape.nshapes) ----- Throw exception ----- local err, msg = pcall(function() c:throwException() end) assert(not err and msg == "SWIG_SystemError:OK") ----- Delete everything ----- c = nil s = nil collectgarbage() assert(v.Shape.nshapes == 0, "Shape.nshapes should be 0 not " .. v.Shape.nshapes)