From 81cb34ef502c6f8fb8378740fb695214988dde31 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 23 Feb 2024 11:59:45 +0000 Subject: util.strbitop: Rename spec file to correct name so tests actually run --- spec/util_strbitop.lua | 41 ----------------------------------------- spec/util_strbitop_spec.lua | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 41 deletions(-) delete mode 100644 spec/util_strbitop.lua create mode 100644 spec/util_strbitop_spec.lua diff --git a/spec/util_strbitop.lua b/spec/util_strbitop.lua deleted file mode 100644 index 58a13772..00000000 --- a/spec/util_strbitop.lua +++ /dev/null @@ -1,41 +0,0 @@ -local strbitop = require "util.strbitop"; -describe("util.strbitop", function () - describe("sand()", function () - it("works", function () - assert.equal(string.rep("Aa", 100), strbitop.sand(string.rep("a", 200), "Aa")); - end); - it("returns empty string if first argument is empty", function () - assert.equal("", strbitop.sand("", "")); - assert.equal("", strbitop.sand("", "key")); - end); - it("returns initial string if key is empty", function () - assert.equal("hello", strbitop.sand("hello", "")); - end); - end); - - describe("sor()", function () - it("works", function () - assert.equal(string.rep("a", 200), strbitop.sor(string.rep("Aa", 100), "a")); - end); - it("returns empty string if first argument is empty", function () - assert.equal("", strbitop.sor("", "")); - assert.equal("", strbitop.sor("", "key")); - end); - it("returns initial string if key is empty", function () - assert.equal("hello", strbitop.sor("hello", "")); - end); - end); - - describe("sxor()", function () - it("works", function () - assert.equal(string.rep("Aa", 100), strbitop.sxor(string.rep("a", 200), " \0")); - end); - it("returns empty string if first argument is empty", function () - assert.equal("", strbitop.sxor("", "")); - assert.equal("", strbitop.sxor("", "key")); - end); - it("returns initial string if key is empty", function () - assert.equal("hello", strbitop.sxor("hello", "")); - end); - end); -end); diff --git a/spec/util_strbitop_spec.lua b/spec/util_strbitop_spec.lua new file mode 100644 index 00000000..58a13772 --- /dev/null +++ b/spec/util_strbitop_spec.lua @@ -0,0 +1,41 @@ +local strbitop = require "util.strbitop"; +describe("util.strbitop", function () + describe("sand()", function () + it("works", function () + assert.equal(string.rep("Aa", 100), strbitop.sand(string.rep("a", 200), "Aa")); + end); + it("returns empty string if first argument is empty", function () + assert.equal("", strbitop.sand("", "")); + assert.equal("", strbitop.sand("", "key")); + end); + it("returns initial string if key is empty", function () + assert.equal("hello", strbitop.sand("hello", "")); + end); + end); + + describe("sor()", function () + it("works", function () + assert.equal(string.rep("a", 200), strbitop.sor(string.rep("Aa", 100), "a")); + end); + it("returns empty string if first argument is empty", function () + assert.equal("", strbitop.sor("", "")); + assert.equal("", strbitop.sor("", "key")); + end); + it("returns initial string if key is empty", function () + assert.equal("hello", strbitop.sor("hello", "")); + end); + end); + + describe("sxor()", function () + it("works", function () + assert.equal(string.rep("Aa", 100), strbitop.sxor(string.rep("a", 200), " \0")); + end); + it("returns empty string if first argument is empty", function () + assert.equal("", strbitop.sxor("", "")); + assert.equal("", strbitop.sxor("", "key")); + end); + it("returns initial string if key is empty", function () + assert.equal("hello", strbitop.sxor("hello", "")); + end); + end); +end); -- cgit v1.2.3