flutter/packages/flutter_tools/test/base/bsdiff_test.dart
Stanislav Baranov b47da6c2b7
Add support for binary compression of dynamic patches by the flutter tool. (#27754)
This reduces the typical dynamic patch size by more than 10x.

Also see https://github.com/flutter/engine/pull/7777 for decompression support in the runtime.
2019-02-11 16:57:26 -08:00

21 lines
600 B
Dart

// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:typed_data';
import 'package:flutter_tools/src/base/bsdiff.dart';
import '../src/common.dart';
void main() {
group('Main', () {
test('generates diff', () {
final Uint8List a = Uint8List.fromList('Hello'.runes.toList());
final Uint8List b = Uint8List.fromList('World'.runes.toList());
final Uint8List c = Uint8List.fromList(bsdiff(a, b));
expect(bspatch(a, c), equals(b));
});
});
}