[squeak-dev] TestRunner not assigning strings/remembering old values
of temp vars.
Rob Withers
reefedjib at yahoo.com
Sun Jul 25 07:36:55 UTC 2010
I am testing the CryptoDESTest. I am getting some strange behavior. When I
run the following code in a Workspace, repeatably, I get the same results:
code:
| plain key d |
plain := 'squeaker'.
key := 'hacking!'.
Transcript cr; show: 'plain: ', plain printString.
d := DES key: key.
d encryptBlock: plain.
Transcript cr; show: 'plain: ', plain printString.
self assert: plain asByteArray = #[64 222 70 13 59 145 76 186].
plain destroy.
output:
plain: 'squeaker'
plain: '@ÞF
;Lº'
plain: 'squeaker'
plain: '@ÞF
;Lº'
plain: 'squeaker'
plain: '@ÞF
;Lº'
However, when I run this as a test method:
testDES3
| plain key d |
plain := 'squeaker'.
key := 'hacking!'.
Transcript cr; show: 'plain: ', plain printString.
d := DES key: key.
d encryptBlock: plain.
Transcript cr; show: 'plain: ', plain printString.
self assert: plain asByteArray = #[64 222 70 13 59 145 76 186].
plain destroy.
I get the following output and the test fails:
plain: 'squeaker'
plain: '@ÞF
;Lº'
plain: ' '
plain: '£¼ïùmÞ$'
plain: '£¼ïùmÞ$'
plain: '§,}ºé¨öú'
plain: '§,}ºé¨öú'
plain: '3qX¦wRË|'
plain: '3qX¦wRË|'
plain: 'Ê0ê^ó{ì'
plain: 'Ê0ê^ó{ì'
plain: 'çî³,ίw'
Why is test runner remembering the old value and not setting it with: plain
:= 'squeaker'.?
TIA,
Rob
More information about the Squeak-dev
mailing list
|