spec/util_format_spec.lua
changeset 12037 161f8268c4b3
parent 12036 3db09eb4c43b
child 12038 ee94ac51b2dd
--- a/spec/util_format_spec.lua	Sat Dec 11 13:30:34 2021 +0100
+++ b/spec/util_format_spec.lua	Sat Dec 11 13:39:58 2021 +0100
@@ -25,5 +25,14 @@
 			assert.equal("\"Hello w\\195rld\"", format("%s", "Hello w\195rld"));
 		end);
 
+		if _VERSION >= "Lua 5.4" then
+			it("handles %p formats", function ()
+				assert.matches("a 0x%x+ b", format("%s %p %s", "a", {}, "b"));
+			end)
+		else
+			it("does something with %p formats", function ()
+				assert.string(format("%p", {}));
+			end)
+		end
 	end);
 end);