summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Examples/test-suite/li_std_string.i2
-rw-r--r--Examples/test-suite/lua/li_std_string_runme.lua6
2 files changed, 7 insertions, 1 deletions
diff --git a/Examples/test-suite/li_std_string.i b/Examples/test-suite/li_std_string.i
index 209cf883f..6f8fec130 100644
--- a/Examples/test-suite/li_std_string.i
+++ b/Examples/test-suite/li_std_string.i
@@ -1,7 +1,7 @@
%module li_std_string
%include <std_string.i>
-#if defined(SWIGPHP) || defined(SWIGUTL)
+#if defined(SWIGLUA) || defined(SWIGPHP) || defined(SWIGUTL)
%apply std::string& INPUT { std::string &input }
%apply std::string& INOUT { std::string &inout }
%apply std::string& OUTPUT { std::string &output }
diff --git a/Examples/test-suite/lua/li_std_string_runme.lua b/Examples/test-suite/lua/li_std_string_runme.lua
index 40de81e44..4e6dbe7f1 100644
--- a/Examples/test-suite/lua/li_std_string_runme.lua
+++ b/Examples/test-suite/lua/li_std_string_runme.lua
@@ -44,6 +44,12 @@ test_reference(robj)
test_reference(obj) -- object ptr is ok
test_reference(cobj) -- obj const ptr is also ok
+-- Test INPUT, INOUT and OUTPUT string& typemaps:
+assert(test_reference_input("hello")=="hello")
+s=test_reference_inout("hello")
+assert(s=="hellohello")
+assert(test_reference_output()=="output")
+
-- throwing string
ok,ex=pcall(test_throw)
assert(ok==false and type(ex)=="string") -- failed & threw string