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

Unified Diff: tests/lib/crypto/sha256_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/sha1_test.dart ('k') | tools/test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/crypto/sha256_test.dart
diff --git a/tests/lib/crypto/sha256_test.dart b/tests/lib/crypto/sha256_test.dart
index 5e7ec1e601f13244cc91e0c11db8b8c26c21224a..36d7ecafe60a0982cbd5edcf602e07165275fd3a 100644
--- a/tests/lib/crypto/sha256_test.dart
+++ b/tests/lib/crypto/sha256_test.dart
@@ -293,10 +293,13 @@ void test() {
void testInvalidUse() {
var sha = new SHA256();
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 SHA256();
+ var digest = sha.digest();
+ Expect.listEquals(digest, sha.digest());
}
void testStandardVectors(inputs, mds) {
@@ -309,6 +312,7 @@ void testStandardVectors(inputs, mds) {
void main() {
test();
testInvalidUse();
+ testRepeatedDigest();
testStandardVectors(sha256_long_inputs, sha256_long_mds);
testStandardVectors(sha256_short_inputs, sha256_short_mds);
}
« no previous file with comments | « tests/lib/crypto/sha1_test.dart ('k') | tools/test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698