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

Unified Diff: test/sha256_test.dart

Side-by-side diff isn't available for this file because of its large size.
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 | « test/sha1_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/sha256_test.dart
diff --git a/test/sha256_test.dart b/test/sha256_test.dart
index a56d75af5dfcdb6dd0bf4adb237ec1ad9800c025..1c6653e311d0f9d8bbae266df7d0d0ec994b1fd3 100644
--- a/test/sha256_test.dart
+++ b/test/sha256_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:test/test.dart";
import "package:crypto/crypto.dart";
@@ -24,6 +25,21 @@ 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(
+ "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b8"
+ "55"));
+ }));
+
+ var outer = sha256.startChunkedConversion(inner);
+ outer.close();
+ });
});
group("standard vector", () {
« no previous file with comments | « test/sha1_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698