From 72cfc3161c17b9f4978e4d55186d4cd6c5e1b315 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 3 Nov 2017 15:44:39 +0100 Subject: spec/util.encodings: Test an UTF-8 sequence --- spec/util_encodings_spec.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'spec') diff --git a/spec/util_encodings_spec.lua b/spec/util_encodings_spec.lua index 584fb4e6..018b8553 100644 --- a/spec/util_encodings_spec.lua +++ b/spec/util_encodings_spec.lua @@ -8,6 +8,7 @@ describe("util.encodings", function () assert.is.equal(encodings.base64.encode(""), ""); assert.is.equal(encodings.base64.encode('coucou'), "Y291Y291"); assert.is.equal(encodings.base64.encode("\0\0\0"), "AAAA"); + assert.is.equal(encodings.base64.encode("\255\255\255"), "////"); end); end); describe("#decode()", function() @@ -15,6 +16,7 @@ describe("util.encodings", function () assert.is.equal(encodings.base64.decode(""), ""); assert.is.equal(encodings.base64.decode('Y291Y291'), "coucou"); assert.is.equal(encodings.base64.decode("AAAA"), "\0\0\0"); + assert.is.equal(encodings.base64.decode("////"), "\255\255\255"); end); end); end); -- cgit v1.2.3