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

Unified Diff: tests/lib/convert/base64_test.dart

Issue 1630933004: Fix type-error in base64.dart (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added test Created 4 years, 11 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 | « sdk/lib/convert/base64.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/convert/base64_test.dart
diff --git a/tests/lib/convert/base64_test.dart b/tests/lib/convert/base64_test.dart
index ccbed3dea09a976ab53db96a5aff6a4060c872ef..457e330d8fc195d07a487661b0ea57fab0d95e7b 100644
--- a/tests/lib/convert/base64_test.dart
+++ b/tests/lib/convert/base64_test.dart
@@ -20,6 +20,7 @@ main() {
testRoundtrip(new Uint8List.fromList(list), "Uint8List#${list.length}");
}
testErrors();
+ testIssue25577();
// Decoder is lenienet with mixed styles.
Expect.listEquals([0xfb, 0xff, 0xbf, 0x00], BASE64.decode("-_+/AA%3D="));
@@ -236,3 +237,18 @@ void testErrors() {
badEncode(0x100000000); /// 01: ok
badEncode(0x10000000000000000); /// 01: continued
}
+
+void testIssue25577() {
+ // Regression test for http://dartbug.com/25577
+ // Should not fail in checked mode.
+ StringConversionSink decodeSink =
+ BASE64.decoder.startChunkedConversion(new TestSink<List<int>>());
+ ByteConversionSink encodeSink =
+ BASE64.encoder.startChunkedConversion(new TestSink<String>());
+}
+
+// Implementation of Sink<T> to test type constraints.
+class TestSink<T> implements Sink<T> {
+ void add(T value) {}
+ void close() {}
+}
« no previous file with comments | « sdk/lib/convert/base64.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698