summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/rsc/imap/decode_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-05-12 23:56:07 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-12 23:56:07 -0400
commit38ee83e45b4de7edf89bf9f0ef629eb4c6ad0fa8 (patch)
treea4fde09672192b97d453ad605b030bd5a10c5a45 /vendor/github.com/mattermost/rsc/imap/decode_test.go
parent84d2482ddbff9564c9ad75b2d30af66e3ddfd44d (diff)
downloadchat-38ee83e45b4de7edf89bf9f0ef629eb4c6ad0fa8.tar.gz
chat-38ee83e45b4de7edf89bf9f0ef629eb4c6ad0fa8.tar.bz2
chat-38ee83e45b4de7edf89bf9f0ef629eb4c6ad0fa8.zip
Moving to glide
Diffstat (limited to 'vendor/github.com/mattermost/rsc/imap/decode_test.go')
-rw-r--r--vendor/github.com/mattermost/rsc/imap/decode_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/github.com/mattermost/rsc/imap/decode_test.go b/vendor/github.com/mattermost/rsc/imap/decode_test.go
new file mode 100644
index 000000000..84c31f63a
--- /dev/null
+++ b/vendor/github.com/mattermost/rsc/imap/decode_test.go
@@ -0,0 +1,26 @@
+package imap
+
+import "testing"
+
+var unrfc2047Tests = []struct {
+ in, out string
+}{
+ {"hello world", "hello world"},
+ {"hello =?iso-8859-1?q?this is some text?=", "hello this is some text"},
+ {"=?US-ASCII?Q?Keith_Moore?=", "Keith Moore"},
+ {"=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?=", "Keld Jørn Simonsen"},
+ {"=?ISO-8859-1?Q?Andr=E9?= Pirard", "André Pirard"},
+ {"=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=", "If you can read this yo"},
+ {"=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=", "u understand the example."},
+ {"=?ISO-8859-1?Q?Olle_J=E4rnefors?=", "Olle Järnefors"},
+ // {"=?iso-2022-jp?B?GyRCTTVKISRKP006SiRyS34kPyQ3JEZKcz03JCIkahsoQg==?=", ""},
+ {"=?UTF-8?B?Ik5pbHMgTy4gU2Vsw6VzZGFsIg==?=", `"Nils O. Selåsdal"`},
+}
+
+func TestUnrfc2047(t *testing.T) {
+ for _, tt := range unrfc2047Tests {
+ if out := unrfc2047(tt.in); out != tt.out {
+ t.Errorf("unrfc2047(%#q) = %#q, want %#q", tt.in, out, tt.out)
+ }
+ }
+}