aboutsummaryrefslogtreecommitdiff
path: root/advtrains/spec/texture_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/spec/texture_spec.lua')
-rw-r--r--advtrains/spec/texture_spec.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/advtrains/spec/texture_spec.lua b/advtrains/spec/texture_spec.lua
new file mode 100644
index 0000000..2e3bd5d
--- /dev/null
+++ b/advtrains/spec/texture_spec.lua
@@ -0,0 +1,19 @@
+package.path = "../?.lua;" .. package.path
+local T = require "texture"
+
+describe("Texture creation", function()
+ it("works", function()
+ assert.same("^.png", tostring(T.raw"^.png"))
+ assert.same("foo\\:bar.png", tostring(T"foo:bar.png"))
+ end)
+end)
+
+describe("Texture modifiers", function()
+ it("work", function()
+ assert.same("x^[colorize:c", tostring(T"x":colorize"c"))
+ assert.same("x^[colorize:c:alpha", tostring(T"x":colorize("c", "alpha")))
+ assert.same("x^[multiply:c", tostring(T"x":multiply"c"))
+ assert.same("x^[resize:2x3", tostring(T"x":resize(2, 3)))
+ assert.same("x^[transformI", tostring(T"x":transform"I"))
+ end)
+end)
tr">"':") local stopcnt=ringbufcnt[tid] if not stopcnt then atdebug("ID unknown!") return end repeat local t = ringbufs[tid][ringbufcnt[tid]] if t then atdebug(t) end ringbufcnt[tid]=ringbufcnt[tid]+1 if ringbufcnt[tid] > ringbuflen then ringbufcnt[tid]=0 end until ringbufcnt[tid]==stopcnt end minetest.register_chatcommand("atdebug_show", { params = "train sid", -- Short parameter description description = "Dump debug log", -- Full description privs = {train_operator=true}, -- Require the "privs" privilege to run func = function(name, param) advtrains.drb_dump(param) end, -- Called when command is run. -- Returns boolean success and text output. })