﻿'From Pharo3.0 of 18 March 2013 [Latest update: #30592] on 6 December 2013 at 8:10:52.027714 pm'!TestCase subclass: #QuotedPrintableCoderTest	instanceVariableNames: 'coder'	classVariableNames: ''	poolDictionaries: ''	category: 'Network-MIME'!!QuotedPrintableCoderTest commentStamp: '<historical>' prior: 0!!!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:33'!testDecodeSoftLinebreak	self 		assert: (coder decode: 'This is text may not be= decoded as two lines')	equals: 'This is text may not be decoded as two lines'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 20:03'!testEncodeSoftLinebreak	| original encoded |	original :=		'Cowards die many times before their deaths; The valiant never taste of death but once.',		String crlf,		'Of all the wonders that I yet have heard, it seems to me most strange that men should fear;',		String crlf,		'Seeing that death, a necessary end, will come when it will come'.	encoded :=		'Cowards die many times before their deaths; The valiant never taste of dea=th but once.=0D=0AOf all the wonders that I yet have heard, it seems to me most strange that= men should fear;=0D=0ASeeing that death, a necessary end, will come when it will come'.	self assert: (coder encode: original) equals: encoded.		self assert: (coder decode: encoded) equals: original! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:33'!testDecodeDecodedStrings	self 		assert: (coder decode: 'Hätten Hüte ein ß im Namen, wären sie möglicherweise keine Hüte mehr')		equals: 'Hätten Hüte ein ß im Namen, wären sie möglicherweise keine Hüte mehr'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:33'!testDecodeSimpleStrings	self 		assert: (coder decode: 'Z=FCrich') 		equals: 'Zürich'.	self 		assert: (coder decode: 'H=E4tten H=FCte ein =DF im Namen, w=E4ren sie m=F6glicherweise keine H=FCte mehr') 		equals: 'Hätten Hüte ein ß im Namen, wären sie möglicherweise keine Hüte mehr'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:34'!testEncodeSimpleStrings	self 		assert: (coder encode: 'Zürich')		equals: 'Z=FCrich'.	self 		assert: (coder encode: 'Über die Fährverbindungen nach Föhr wüßte ich nicht viel')		equals: '=DCber die F=E4hrverbindungen nach F=F6hr w=FC=DFte ich nicht viel'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:34'!testEncodeEncodedStrings	"An = becomes =3D and is then not decodable any more (only if you know you have to do it twice ;-) )"	self assert: (coder encode: 'Z=FCrich') equals: 'Z=3DFCrich'! !!QuotedPrintableCoderTest methodsFor: 'running' stamp: 'SvenVanCaekenberghe 12/6/2013 18:32'!setUp	coder := QuotedPrintableCoder! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 20:02'!testDecodeCRLF	self 		assert: (coder decode: 'This is the first line=0D=0A and this is the second')		equals: 'This is the first line', String crlf, ' and this is the second'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:33'!testEncodeCRLF	self 		assert: (coder encode: 'This is the first line and this is the second')		equals: 'This is the first line=0D=0A and this is the second'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:34'!testEncodeEncodedStrings	"An = becomes =3D and is then not decodable any more (only if you know you have to do it twice ;-) )"	self assert: (coder encode: 'Z=FCrich') equals: 'Z=3DFCrich'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 20:02'!testDecodeCRLF	self 		assert: (coder decode: 'This is the first line=0D=0A and this is the second')		equals: 'This is the first line', String crlf, ' and this is the second'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:33'!testEncodeCRLF	self 		assert: (coder encode: 'This is the first line and this is the second')		equals: 'This is the first line=0D=0A and this is the second'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:34'!testEncodeSimpleStrings	self 		assert: (coder encode: 'Zürich')		equals: 'Z=FCrich'.	self 		assert: (coder encode: 'Über die Fährverbindungen nach Föhr wüßte ich nicht viel')		equals: '=DCber die F=E4hrverbindungen nach F=F6hr w=FC=DFte ich nicht viel'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 20:03'!testEncodeSoftLinebreak	| original encoded |	original :=		'Cowards die many times before their deaths; The valiant never taste of death but once.',		String crlf,		'Of all the wonders that I yet have heard, it seems to me most strange that men should fear;',		String crlf,		'Seeing that death, a necessary end, will come when it will come'.	encoded :=		'Cowards die many times before their deaths; The valiant never taste of dea=th but once.=0D=0AOf all the wonders that I yet have heard, it seems to me most strange that= men should fear;=0D=0ASeeing that death, a necessary end, will come when it will come'.	self assert: (coder encode: original) equals: encoded.		self assert: (coder decode: encoded) equals: original! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:33'!testDecodeDecodedStrings	self 		assert: (coder decode: 'Hätten Hüte ein ß im Namen, wären sie möglicherweise keine Hüte mehr')		equals: 'Hätten Hüte ein ß im Namen, wären sie möglicherweise keine Hüte mehr'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:33'!testDecodeSimpleStrings	self 		assert: (coder decode: 'Z=FCrich') 		equals: 'Zürich'.	self 		assert: (coder decode: 'H=E4tten H=FCte ein =DF im Namen, w=E4ren sie m=F6glicherweise keine H=FCte mehr') 		equals: 'Hätten Hüte ein ß im Namen, wären sie möglicherweise keine Hüte mehr'! !!QuotedPrintableCoderTest methodsFor: 'tests' stamp: 'SvenVanCaekenberghe 12/6/2013 18:33'!testDecodeSoftLinebreak	self 		assert: (coder decode: 'This is text may not be= decoded as two lines')	equals: 'This is text may not be decoded as two lines'! !!QuotedPrintableCoderTest methodsFor: 'running' stamp: 'SvenVanCaekenberghe 12/6/2013 18:32'!setUp	coder := QuotedPrintableCoder! !