Patrick Rein uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-pre.289.mcz ==================== Summary ==================== Name: CollectionsTests-pre.289 Author: pre Time: 30 April 2018, 3:43:01.993101 pm UUID: 46cee9a7-0d7e-ab45-9dea-7b783e5992d0 Ancestors: CollectionsTests-pre.288 Adds test cases for q format and categorizes test methods for the quoted printable mime converter. =============== Diff against CollectionsTests-pre.288 =============== Item was added: + TestCase subclass: #QFormatMimeConverterTest + instanceVariableNames: 'message' + classVariableNames: '' + poolDictionaries: '' + category: 'CollectionsTests-Streams'! Item was added: + ----- Method: QFormatMimeConverterTest>>setUp (in category 'running') ----- + setUp + message := 'Hü Thörä!!' readStream. + ! Item was added: + ----- Method: QFormatMimeConverterTest>>testDecode (in category 'running') ----- + testDecode + + | encodedString decodedString | + encodedString := '=E0'. + decodedString := QEncodingMimeConverter mimeDecode: encodedString as: WideString. + self assert: 'à' equals: decodedString. + + encodedString := 'H=FC_Th=F6r=E4!!'. + decodedString := QEncodingMimeConverter mimeDecode: encodedString as: WideString. + self assert: 'Hü Thörä!!' equals: decodedString. + + encodedString := 'H=FC=20Th=F6r=E4!!'. + decodedString := QEncodingMimeConverter mimeDecode: encodedString as: WideString. + self assert: 'Hü Thörä!!' equals: decodedString.! Item was added: + ----- Method: QFormatMimeConverterTest>>testEncodeSimpleString (in category 'running') ----- + testEncodeSimpleString + + | encodedString | + encodedString := QEncodingMimeConverter mimeEncode: message. + self assert: '=?UTF-8?Q?H=C3=BC?= =?UTF-8?Q?Th=C3=B6r=C3=A4!!?=' equals: encodedString. + ! Item was added: + ----- Method: QFormatMimeConverterTest>>testEncodeSimpleStringWithQuestionMark (in category 'running') ----- + testEncodeSimpleStringWithQuestionMark + + | encodedString | + encodedString := QEncodingMimeConverter mimeEncode: 'Is üt?'. + self assert: 'Is =?UTF-8?Q?=C3=BCt=3F?=' equals: encodedString. + ! Item was added: + ----- Method: QFormatMimeConverterTest>>testRoundtrip (in category 'running') ----- + testRoundtrip + + | result start | + start := 'Is üt?'. + result := ((QEncodingMimeConverter mimeEncode: start) as: String) decodeMimeHeader. + self assert: start equals: result. + ! Item was changed: + ----- Method: QuotedPrintableMimeConverterTest>>setUp (in category 'running') ----- - ----- Method: QuotedPrintableMimeConverterTest>>setUp (in category 'as yet unclassified') ----- setUp message := 'Hü Thörä!!' readStream. ! Item was changed: + ----- Method: QuotedPrintableMimeConverterTest>>testDecode (in category 'tests') ----- - ----- Method: QuotedPrintableMimeConverterTest>>testDecode (in category 'as yet unclassified') ----- testDecode | encodedString decodedString | encodedString := '=E0'. decodedString := QuotedPrintableMimeConverter mimeDecode: encodedString as: WideString. self assert: 'à' equals: decodedString. encodedString := 'H=FC Th=F6r=E4!!'. decodedString := QuotedPrintableMimeConverter mimeDecode: encodedString as: WideString. + self assert: 'Hü Thörä!!' equals: decodedString.! - self assert: 'Hü Thörä!!' equals: decodedString. - - ! Item was changed: + ----- Method: QuotedPrintableMimeConverterTest>>testDecodeCrLfToCr (in category 'tests') ----- - ----- Method: QuotedPrintableMimeConverterTest>>testDecodeCrLfToCr (in category 'as yet unclassified') ----- testDecodeCrLfToCr | encodedString decodedString targetString | encodedString := ((WriteStream on: '') << 'a'; crlf; << 'b') contents. decodedString := QuotedPrintableMimeConverter mimeDecode: encodedString as: WideString. targetString := encodedString := ((WriteStream on: '') << 'a'; cr; << 'b') contents. self assert: targetString equals: decodedString.! Item was changed: + ----- Method: QuotedPrintableMimeConverterTest>>testDecodeMultiline (in category 'tests') ----- - ----- Method: QuotedPrintableMimeConverterTest>>testDecodeMultiline (in category 'as yet unclassified') ----- testDecodeMultiline | encodedString decodedString | encodedString := 'A multiline = encoded text which isn''t'. decodedString := QuotedPrintableMimeConverter mimeDecode: encodedString as: WideString. self assert: 'A multiline encoded text which isn''t' equals: decodedString. ! Item was changed: + ----- Method: QuotedPrintableMimeConverterTest>>testEncodeEqualSign (in category 'tests') ----- - ----- Method: QuotedPrintableMimeConverterTest>>testEncodeEqualSign (in category 'as yet unclassified') ----- testEncodeEqualSign | encodedString | encodedString := QuotedPrintableMimeConverter mimeEncode: 'e=mc2'. self assert: 'e=3Dmc2' equals: encodedString. ! Item was changed: + ----- Method: QuotedPrintableMimeConverterTest>>testEncodeMultilineString (in category 'tests') ----- - ----- Method: QuotedPrintableMimeConverterTest>>testEncodeMultilineString (in category 'as yet unclassified') ----- testEncodeMultilineString | encodedString sourceString targetString | sourceString := 'a multi- line string'. encodedString := QuotedPrintableMimeConverter mimeEncode: sourceString. targetString := 'a multi-' , String crlf , 'line string'. self assert: targetString equals: encodedString.! Item was changed: + ----- Method: QuotedPrintableMimeConverterTest>>testEncodeSimpleString (in category 'tests') ----- - ----- Method: QuotedPrintableMimeConverterTest>>testEncodeSimpleString (in category 'as yet unclassified') ----- testEncodeSimpleString | encodedString | encodedString := QuotedPrintableMimeConverter mimeEncode: message. self assert: 'H=FC Th=F6r=E4!!' equals: encodedString. ! Item was changed: + ----- Method: QuotedPrintableMimeConverterTest>>testEncodeWhitespace (in category 'tests') ----- - ----- Method: QuotedPrintableMimeConverterTest>>testEncodeWhitespace (in category 'as yet unclassified') ----- testEncodeWhitespace | encodedString sourceString targetString | sourceString := 'a string with all the whitespace'. encodedString := QuotedPrintableMimeConverter mimeEncode: sourceString. targetString := 'a string with all the whitespace'. self assert: targetString equals: encodedString.! Item was changed: + ----- Method: QuotedPrintableMimeConverterTest>>testEncodingBreaksUpLongLInes (in category 'tests') ----- - ----- Method: QuotedPrintableMimeConverterTest>>testEncodingBreaksUpLongLInes (in category 'as yet unclassified') ----- testEncodingBreaksUpLongLInes | encodedString | encodedString := QuotedPrintableMimeConverter mimeEncode: 'This is a very long message which has more than 76 characters due to this additional part of the sentence.'. self assert: 'This is a very long message which has more than 76 characters due to this=', String crlf , ' additional part of the sentence.' equals: encodedString. ! |
Free forum by Nabble | Edit this page |