validation: cover nil/None return from lua_func/py_func
Two new steps per language: function returning nothing and function returning explicit nil/None. Both tagged $(test)_PASS — they would have failed before the lua nil fix (Lua side reported nil result as error). Python side already worked but is covered for parity.
This commit is contained in:
@@ -49,4 +49,12 @@ function module.test_delgd()
|
||||
return 0
|
||||
end
|
||||
|
||||
function module.return_nothing()
|
||||
-- Returns no value: ret is nil but no error.
|
||||
end
|
||||
|
||||
function module.return_explicit_nil()
|
||||
return nil
|
||||
end
|
||||
|
||||
return module
|
||||
@@ -186,6 +186,18 @@
|
||||
file: $(test_path)$(psep)lua_func.lua
|
||||
func_name: test_delgd
|
||||
|
||||
- lua_func:
|
||||
name: function returning nothing should succeed
|
||||
key: $(test)_PASS
|
||||
file: $(test_path)$(psep)lua_func.lua
|
||||
func_name: return_nothing
|
||||
|
||||
- lua_func:
|
||||
name: function returning explicit nil should succeed
|
||||
key: $(test)_PASS
|
||||
file: $(test_path)$(psep)lua_func.lua
|
||||
func_name: return_explicit_nil
|
||||
|
||||
- group:
|
||||
name: context_id tests
|
||||
steps:
|
||||
|
||||
@@ -54,3 +54,10 @@ def test_delgd():
|
||||
tm.delgd("_py_delgd_test")
|
||||
assert tm.gd("_py_delgd_test", None) is None
|
||||
return 0
|
||||
|
||||
def return_nothing():
|
||||
# Falls off the end: implicit None return, no error.
|
||||
pass
|
||||
|
||||
def return_explicit_none():
|
||||
return None
|
||||
|
||||
@@ -196,6 +196,18 @@
|
||||
file: $(test_path)$(psep)py_func.py
|
||||
func_name: test_delgd
|
||||
|
||||
- py_func:
|
||||
name: function returning nothing should succeed
|
||||
key: $(test)_PASS
|
||||
file: $(test_path)$(psep)py_func.py
|
||||
func_name: return_nothing
|
||||
|
||||
- py_func:
|
||||
name: function returning explicit None should succeed
|
||||
key: $(test)_PASS
|
||||
file: $(test_path)$(psep)py_func.py
|
||||
func_name: return_explicit_none
|
||||
|
||||
- group:
|
||||
name: context_id tests
|
||||
steps:
|
||||
|
||||
Reference in New Issue
Block a user