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

Unified Diff: tests/lib/src/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: Address first round of review comments. 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
Index: tests/lib/src/crypto/sha1_test.dart
diff --git a/tests/lib/src/crypto/sha1Test.dart b/tests/lib/src/crypto/sha1_test.dart
similarity index 99%
rename from tests/lib/src/crypto/sha1Test.dart
rename to tests/lib/src/crypto/sha1_test.dart
index 88334eb10b54b3ba331874ff7b7151159cf1f42d..4153e596d9b9ce4abcecaaf4c89d3211c03211c0 100644
--- a/tests/lib/src/crypto/sha1Test.dart
+++ b/tests/lib/src/crypto/sha1_test.dart
@@ -548,10 +548,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) {
@@ -564,6 +567,7 @@ void testStandardVectors(inputs, mds) {
void main() {
test();
testInvalidUse();
+ testRepeatedDigest();
testStandardVectors(sha1_long_inputs, sha1_long_mds);
testStandardVectors(sha1_short_inputs, sha1_short_mds);
}

Powered by Google App Engine
This is Rietveld 408576698