summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-pack/test/pack.rb
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-pack/test/pack.rb')
-rw-r--r--mrbgems/mruby-pack/test/pack.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/mrbgems/mruby-pack/test/pack.rb b/mrbgems/mruby-pack/test/pack.rb
index 93f5d8d46..56f63a3d7 100644
--- a/mrbgems/mruby-pack/test/pack.rb
+++ b/mrbgems/mruby-pack/test/pack.rb
@@ -28,6 +28,17 @@ assert('pack("m")') do
assert_pack "m0", "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWg==", ["abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"]
end
+# pack & unpack 'M' (Quoted-printable)
+assert('pack("M")') do
+ assert_pack "M", "123=\n", ["123"]
+ assert_pack "M", "=3D\n", ["=\n"]
+ assert_pack "M", "=E3=81=82=\n", ["あ"]
+
+ assert_equal ["123"], "123=\n".unpack("M")
+ assert_equal ["=\n"], "=3D\n".unpack("M")
+ assert_equal ["あ"], "=E3=81=82=\n".unpack("M")
+end
+
# pack & unpack 'H'
assert('pack("H")') do
assert_pack "H*", "01", ["3031"]