aboutsummaryrefslogtreecommitdiff
path: root/tests/simple
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2026-04-20 19:30:28 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2026-04-20 19:30:28 +0200
commite371c801fed71bb73bc7c027e3de5ad2a6116673 (patch)
treee6818b34fed4723d8c44d71f8c6d1a68e44c4c8d /tests/simple
parent47a5607a691a576928896f21bcf563c011dc64e5 (diff)
add tests and fix path resolution bugHEADmaster
Diffstat (limited to 'tests/simple')
-rw-r--r--tests/simple/build.lua8
-rw-r--r--tests/simple/test.py39
2 files changed, 47 insertions, 0 deletions
diff --git a/tests/simple/build.lua b/tests/simple/build.lua
new file mode 100644
index 0000000..996ccda
--- /dev/null
+++ b/tests/simple/build.lua
@@ -0,0 +1,8 @@
+local template = Template:new()
+
+template:add_file("./test.py", {
+ module = "a_module_that_is_different",
+ name = template:option('name')
+})
+
+return template
diff --git a/tests/simple/test.py b/tests/simple/test.py
new file mode 100644
index 0000000..20c1c7e
--- /dev/null
+++ b/tests/simple/test.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+
+# This module is called @{name()}
+
+import @{module}
+
+print("@{function()
+ return "Hello World"
+end}")
+
+print("@{function()
+ local a = { "asdf", "1234" }
+ return a[1]
+end}")
+
+print(@{function()
+ local a = { "asdf", "1234" } -- {
+ return a[2]
+end})
+
+print("@{function()
+ local a = "asdf{asdf"
+ return a:sub(1)
+end}")
+
+print("@{function()
+ local a = "asdf"
+ --[[
+ some comment }
+ --]]
+ return a
+end}")
+
+print("@{function()
+ local a = [[
+ some comment }
+ ]]
+ return a:sub(2, 8)
+end}")