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

Unified Diff: test/sha1_test.dart

Issue 1906093002: Close underlying Hash sinks. (Closed) Base URL: git@github.com:dart-lang/crypto@master
Patch Set: cr Created 4 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:
Download patch
« no previous file with comments | « pubspec.yaml ('k') | test/sha256_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/sha1_test.dart
diff --git a/test/sha1_test.dart b/test/sha1_test.dart
index 5b7398b2bf4bf286e2d8793643f4b5e036625d84..3b629b0373c8fa41d52172baf8d5ffcd6f3b2636 100644
--- a/test/sha1_test.dart
+++ b/test/sha1_test.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import "dart:async";
+import "dart:convert";
import "package:crypto/crypto.dart";
import "package:test/test.dart";
@@ -24,6 +25,18 @@ void main() {
sink.close();
sink.close();
});
+
+ test('close closes the underlying sink', () {
+ var inner = new ChunkedConversionSink<Digest>.withCallback(
+ expectAsync((accumulated) {
+ expect(accumulated.length, equals(1));
+ expect(accumulated.first.toString(),
+ equals("da39a3ee5e6b4b0d3255bfef95601890afd80709"));
+ }));
+
+ var outer = sha1.startChunkedConversion(inner);
+ outer.close();
+ });
});
group("standard vector", () {
« no previous file with comments | « pubspec.yaml ('k') | test/sha256_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698