From 0c4ad0fdbccf8552e463aa51b24030c9f01bf365 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Fri, 10 Nov 2017 05:46:39 +0100
Subject: util.format: Move tests to spec/

---
 spec/util_format_spec.lua | 13 +++++++++++++
 util/format.lua           | 10 ----------
 2 files changed, 13 insertions(+), 10 deletions(-)
 create mode 100644 spec/util_format_spec.lua

diff --git a/spec/util_format_spec.lua b/spec/util_format_spec.lua
new file mode 100644
index 00000000..19a8af99
--- /dev/null
+++ b/spec/util_format_spec.lua
@@ -0,0 +1,13 @@
+local format = require "util.format".format;
+
+describe("util.format", function()
+	describe("#format()", function()
+		it("should work", function()
+			assert.equal(format("%s", "hello"), "hello");
+			assert.equal(format("%s"), "<nil>");
+			assert.equal(format("%s", true), "true");
+			assert.equal(format("%d", true), "[true]");
+			assert.equal(format("%%", true), "% [true]");
+		end);
+	end);
+end);
diff --git a/util/format.lua b/util/format.lua
index b3296228..99705d03 100644
--- a/util/format.lua
+++ b/util/format.lua
@@ -4,7 +4,6 @@
 
 local tostring = tostring;
 local select = select;
-local assert = assert;
 local unpack = unpack;
 local type = type;
 
@@ -60,15 +59,6 @@ local function format(formatstring, ...)
 	return formatstring:format(unpack(args));
 end
 
-local function test()
-	assert(format("%s", "hello") == "hello");
-	assert(format("%s") == "<nil>");
-	assert(format("%s", true) == "true");
-	assert(format("%d", true) == "[true]");
-	assert(format("%%", true) == "% [true]");
-end
-
 return {
 	format = format;
-	test = test;
 };
-- 
cgit v1.2.3