/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/lua/using_composition_runme.lua
22 строки
918 B
Erez Geva
More Lua tests (#3405)
31 май 2026, 17:09
31 май 2026, 17:09
a1b3ca8
Код
Авторство
О чём код?
local v=require("using_composition") local f = v.FooBar() assert(f:blah(3) == 3, "FooBar::blah(int)") -- Lua uses number for both float and integer -- lua can not differentiate, C/C++ must differentiate function names -- assert(f:blah(3.5) == 3.5, "FooBar::blah(double)") assert(f:blah("hello") == "hello", "FooBar::blah(char *)") f = v.FooBar2() assert(f:blah(3) == 3, "FooBar2::blah(int)") -- Lua uses number for both float and integer -- Lua can not differentiate, C/C++ must differentiate function names -- assert(f:blah(3.5) == 3.5, "FooBar2::blah(double)") assert(f:blah("hello") == "hello", "FooBar2::blah(char *)") f = v.FooBar3() assert(f:blah(3) == 3, "FooBar3::blah(int)") -- Lua uses number for both float and integer -- Lua can not differentiate, C/C++ must differentiate function names -- assert(f:blah(3.5) == 3.5, "FooBar3::blah(double)") assert(f:blah("hello") == "hello", "FooBar3::blah(char *)")