Software /
code /
prosody
Changeset
13427:9677df320992
util.strbitop: Rename spec file to correct name so tests actually run
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 23 Feb 2024 11:59:45 +0000 |
parents | 13426:581899aef96f |
children | 13428:dc1ad5f3f597 |
files | spec/util_strbitop.lua spec/util_strbitop_spec.lua |
diffstat | 2 files changed, 41 insertions(+), 41 deletions(-) [+] |
line wrap: on
line diff
--- a/spec/util_strbitop.lua Thu Feb 22 19:46:52 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -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);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spec/util_strbitop_spec.lua Fri Feb 23 11:59:45 2024 +0000 @@ -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);