package.path = "../?.lua" .. package.path -- This unittest file only makes sure that extremely trivial things do not break. It is not intended to be complete local tr = require("textrender") describe("string to unicode codepoint sequence converter", function() local mbstoucs = tr.mbstoucs it("should convert strings properly", function() assert.same({0x61,0xe9,0x01d8}, mbstoucs("aéǘ")) end) it("should not convert invalid multibyte sequences", function() local function assert_invalid(...) assert.same({}, mbstoucs(string.char(...))) end assert_invalid(65, math.random(128,191), math.random(128,191)) assert_invalid(65, math.random(192,223)) end) end)