Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: tests/lib/crypto/sha1_test.dart

Issue 10170027: Implement HMAC support in lib/crypto. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update after test renaming. Added back lib testing in test.dart." Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib/crypto/hmac_sha256_test_vectors.dart ('k') | tests/lib/crypto/sha256_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/crypto/sha1_test.dart
diff --git a/tests/lib/crypto/sha1_test.dart b/tests/lib/crypto/sha1_test.dart
index 94245c6e3304cfb10019e56473f227cad604cfba..cb8c97066acaf327ef99e32fa658943f45f14cdb 100644
--- a/tests/lib/crypto/sha1_test.dart
+++ b/tests/lib/crypto/sha1_test.dart
@@ -549,10 +549,13 @@ void test() {
void testInvalidUse() {
var sha = new SHA1();
sha.digest();
- Expect.throws(sha.digest,
- (e) => e is CryptoHashException);
- Expect.throws(() => sha.update([0]),
- (e) => e is CryptoHashException);
+ Expect.throws(() => sha.update([0]), (e) => e is HashException);
+}
+
+void testRepeatedDigest() {
+ var sha = new SHA1();
+ var digest = sha.digest();
+ Expect.listEquals(digest, sha.digest());
}
void testStandardVectors(inputs, mds) {
@@ -565,6 +568,7 @@ void testStandardVectors(inputs, mds) {
void main() {
test();
testInvalidUse();
+ testRepeatedDigest();
testStandardVectors(sha1_long_inputs, sha1_long_mds);
testStandardVectors(sha1_short_inputs, sha1_short_mds);
}
« no previous file with comments | « tests/lib/crypto/hmac_sha256_test_vectors.dart ('k') | tests/lib/crypto/sha256_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698