diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testSecureHashFor.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testSecureHashFor.st index f6521ee3..5a6dfb9f 100644 --- a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testSecureHashFor.st +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testSecureHashFor.st @@ -1,9 +1,19 @@ tests testSecureHashFor - "Make sure the platform class provides a #secureHashFor: method. The method is called by Seaside when hashing passwords. The Squeak implementation returns a SHA-1 hash but another equivalent hash method could also be used." + "Make sure the platform class provides a #secureHashFor: method. The method is called by Seaside when hashing passwords. + The Pharo implementation returns a SHA-1 hash but another equivalent hash method could also be used." - | a b | + | a b c d invalidUtf8 e f | a := self platform secureHashFor: 'foobar'. b := self platform secureHashFor: 'foobar'. + self assert: a equals: b. + + c := self platform secureHashFor: #[102 111 111 98 97 114]. + d := self platform secureHashFor: #[102 111 111 98 97 114]. + self assert: c equals: d. - self assert: (a = b) \ No newline at end of file + "The following ensures any byte array can be used (and not only the onces containing valid utf8)" + invalidUtf8 := #[160 161]. + e := self platform secureHashFor: invalidUtf8. + f := self platform secureHashFor: invalidUtf8. + self assert: e equals: f \ No newline at end of file