Skip to content

Commit

Permalink
Add test for chunked conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
filiph committed May 30, 2017
1 parent 2b8400d commit c4e553a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/test_all.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
// code is governed by a BSD-style license that can be found in the LICENSE
// file.

import 'package:test/test.dart';
import 'dart:async';
import 'dart:convert';

import 'package:html_unescape/html_unescape.dart' as lib_full;
import 'package:html_unescape/html_unescape_small.dart' as lib_small;
import 'package:html_unescape/src/base.dart' show HtmlUnescapeBase;
import 'package:test/test.dart';

void main() {
group("Full", () {
Expand All @@ -16,7 +18,14 @@ void main() {
runTests(() => new lib_small.HtmlUnescape());
});

// TODO: add async tests for chunked conversion
test("converts in chunks", () async {
var unescape = new lib_full.HtmlUnescape();

var stream = new Stream.fromIterable(
['This is "awesome&qu'.codeUnits, 'ot;.'.codeUnits]);
expect(stream.transform(UTF8.decoder).transform(unescape).first,
completion('This is "awesome".'));
});
}

void runTests(ConverterFactory converterFactory) {
Expand Down

0 comments on commit c4e553a

Please sign in to comment.