summaryrefslogtreecommitdiff
path: root/test.lua
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-03-30 21:15:09 +0000
committerubq323 <ubq323@ubq323.website>2024-03-30 21:16:33 +0000
commit0061cca2e76b22d0c39b035a30b04d59563ecee5 (patch)
treeb1c90ea03064a78f45821dfe4e54778ef60fab75 /test.lua
parent9f3f88a6ee7b9bd8ab3168d96a81b40e23024cc6 (diff)
is_required and testcase
Diffstat (limited to 'test.lua')
-rw-r--r--test.lua21
1 files changed, 2 insertions, 19 deletions
diff --git a/test.lua b/test.lua
index a03f69a..b5878f3 100644
--- a/test.lua
+++ b/test.lua
@@ -1,19 +1,2 @@
-local n = 0
-local is_required = false
-while true do
- local x = debug.getinfo(n)
- if x == nil then break end
- n = n + 1
- if x.name == 'require' then
- is_required = true
-
- break
- end
-end
-
-if is_required then
- print("required")
-else
- print("cmdlined")
-
-end
+local ir = require'is_required'.is_required
+print(ir())