Test for gzipDecoder (#4772)
* Test for gzipDecoder
* Update gzip_test.dart
diff --git a/test/gzip_test.dart b/test/gzip_test.dart
new file mode 100644
index 0000000..57a28c9
--- /dev/null
+++ b/test/gzip_test.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+@TestOn('vm && browser')
+library;
+
+import 'dart:convert';
+
+import 'package:pub/src/gzip/gzip.dart';
+import 'package:test/test.dart';
+
+void main() {
+ test('gzipDecoder can decode a gzipped string', () async {
+ // "Hello, world!" gzipped
+ final List<int> gzipped = base64.decode(
+ 'H4sIAAAAAAAAA/NIzcnJ11Eozy/KSVEEAObG5usNAAAA',
+ );
+ final decoded = await Stream.value(gzipped).transform(gzipDecoder).toList();
+ expect(utf8.decode(decoded.expand((e) => e).toList()), 'Hello, world!');
+ });
+}