blob: 85bf653bfa96c177a431cdf1811323d0884095d0 [file] [log] [blame]
// Copyright (c) 2017, 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.
/// @assertion ZLibDecoder decoder
/// Get a ZLibDecoder for decoding GZip compressed data.
/// @description Checks that this property returns ZLibDecoder which works as
/// expected
/// @author
import "dart:io";
import "../../../Utils/expect.dart";
check(ZLibDecoder decoder, List<int> toDecode, List<int> expected) {
var decoded = decoder.convert(toDecode);
Expect.listEquals(expected, decoded);
main() {
GZipCodec codec = new GZipCodec();
ZLibEncoder encoder = new ZLibEncoder();
for (int i = 0; i < 256; i++) {
var encoded = encoder.convert([i]);
check(codec.decoder, encoded, [i]);
check(codec.decoder, [], []);