aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests/lua_in_python.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lua_in_python.py')
-rw-r--r--tests/lua_in_python.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/lua_in_python.py b/tests/lua_in_python.py
index 34deaab..eec2042 100644
--- a/tests/lua_in_python.py
+++ b/tests/lua_in_python.py
@@ -9,4 +9,27 @@ except ImportError:
except ImportError:
import lupa
-print(f"Using {lupa.LuaRuntime().lua_implementation} (compiled with {lupa.LUA_VERSION})") \ No newline at end of file
+print(
+ f"Using {lupa.LuaRuntime().lua_implementation} (compiled with {lupa.LUA_VERSION})"
+)
+
+from lupa import LuaRuntime
+
+lua = LuaRuntime(unpack_returned_tuples=True)
+import asyncio
+
+async def get_Dice_Dir():
+ import os
+ await asyncio.sleep(1)
+ return os.path.dirname(os.path.abspath(__file__))
+
+
+lua.globals().getDiceDir = get_Dice_Dir
+
+print(
+ lua.eval(
+ """\
+ getDiceDir()
+ """
+ )
+)