From 7400ec4c52aab43b1036ec88d9dbd6260cf2d759 Mon Sep 17 00:00:00 2001 From: Andrew D. France Date: Wed, 23 Jul 2025 00:58:09 -0500 Subject: luaopen_bit32 is called during initialization. This means the bit32 library is already loaded and available in the global space for scripts running within lush. The test script in the Jenkinsfile just needs to call it directly without using require: ln:27-65: also removed gemini's weird copout at ln:38-39; wont be using gemini anymore for this boilerplate, since it's trying to (and failing to...) 'troubleshoot' for me, unprompted. --- Jenkinsfile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3293c99..51a46d8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,5 @@ +// Jenkinsfile + pipeline { agent any @@ -30,24 +32,23 @@ print("--- Running Lua 5.2 Compatibility Test ---") -- Test 1: Basic functionality print("Basic print test: Hello from Lush!") --- Test 2: Bitwise operations using bit32 library (provided by compat53) -local bit32 = require("bit32") -local a, b = 0x5, 0x3 +-- Test 2: Bitwise operations using the preloaded bit32 library +-- The lush host preloads compat modules, so we don't need to 'require' it. +local a, b = 5, 3 print("Bitwise AND of", a, "and", b, "=", bit32.band(a, b)) print("Bitwise OR of", a, "and", b, "=", bit32.bor(a, b)) -- Test 3: load() function (replaces loadstring in Lua 5.2) -local f = load("return 10 + 20") +local f, err = load("return 10 + 20") if f then print("Loaded function result:", f()) else - print("Failed to load function") + print("Failed to load function:", err) end --- Test 4: table.pack and table.unpack -local t = table.pack(1, 2, 3, nil, 5) -print("Packed table length:", t.n) -print("First 3 values:", table.unpack(t, 1, 3)) +-- Test 4: table.unpack +local t = {1, 2, 3} +print("Unpacked values:", table.unpack(t)) -- Test 5: String operations local str = "Hello, World!" @@ -93,4 +94,4 @@ EOF sh 'docker rmi lush-app:latest || true' } } -} \ No newline at end of file +} -- cgit v1.2.3-59-g8ed1b