class TestSubjectDecoder

Public Instance Methods

test_1() click to toggle source
# File vendor/qwik/lib/qwik/mail-header.rb, line 274
def test_1
  input = "[smd:30] =?ISO-2022-JP?B?GyRCRnxLXDhsJTUlViU4JSclLyVIGyhC?="
  expected = "[smd:30] 日本語サブジェクト"
  actual = QuickML::SubjectDecoder.decode(input)
  ok_eq(expected, actual)
end
test_2() click to toggle source
# File vendor/qwik/lib/qwik/mail-header.rb, line 281
def test_2
  input = "=?ISO-2022-JP?B?UmU6IFtzbWQ6MzA=?==?ISO-2022-JP?B?XSAbJEJGfEtcOGwlNSVWJTglJyUvJUgbKEI=?="
  expected = "Re: [smd:30] 日本語サブジェクト"
  actual = QuickML::SubjectDecoder.decode(input)
  ok_eq(expected, actual)
end
test_3() click to toggle source
# File vendor/qwik/lib/qwik/mail-header.rb, line 288
def test_3
  input = "[smd:31] Re: =?ISO-2022-JP?B?GyRCRnxLXDhsJTUlViU4JSclLyVIGyhC?="
  expected = "[smd:31] Re: 日本語サブジェクト"
  actual = QuickML::SubjectDecoder.decode(input)
  ok_eq(expected, actual)
end
test_4() click to toggle source
# File vendor/qwik/lib/qwik/mail-header.rb, line 295
def test_4
  input = "[smd:32] =?CP932?Q?Re: __=93=FA=96{=8C=EA=83T=83u=83W=83F=83N=83g?="
  expected = "[smd:32] Re:   日本語サブジェクト"
  actual = QuickML::SubjectDecoder.decode(input)
  ok_eq(expected, actual)
end
test_5() click to toggle source
# File vendor/qwik/lib/qwik/mail-header.rb, line 302
def test_5
  input = "=?ISO-2022-JP?B?UmU6IFtzbWQ6MzBdIBskQkZ8S1w4bCU1JVYlOBsoQg==?==?ISO-2022-JP?B?GyRCJSclLyVIGyhC?="
  expected = "Re: [smd:30] 日本語サブジェクト"
  actual = QuickML::SubjectDecoder.decode(input)
  ok_eq(expected, actual)
end
test_cp932_quotedprintable() click to toggle source
# File vendor/qwik/lib/qwik/mail-header.rb, line 260
def test_cp932_quotedprintable
  input = "=?CP932?B?gqAg?="
  expected = "\202\240 "
  actual = QuickML::SubjectDecoder.decode(input)
  ok_eq(expected, actual)
end
test_iso2022jp_base64() click to toggle source
# File vendor/qwik/lib/qwik/mail-header.rb, line 267
def test_iso2022jp_base64
  input = '=?iso-2022-jp?B?GyRCJCIbKEI=?= '
  expected = "\202\240 "
  actual = QuickML::SubjectDecoder.decode(input)
  ok_eq(expected, actual)
end
test_usascii_none() click to toggle source
# File vendor/qwik/lib/qwik/mail-header.rb, line 253
def test_usascii_none
  input = "test"
  expected = "test"
  actual = QuickML::SubjectDecoder.decode(input)
  ok_eq(expected, actual)
end