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

Side by Side Diff: test/codegen/lib/convert/html_escape_test.dart

Issue 1978963002: Upgrade to the latest dart:convert. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « test/codegen/lib/convert/codec2_test.dart ('k') | tool/input_sdk/lib/convert/ascii.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 const _NOOP = 'Nothing_to_escape'; 9 const _NOOP = 'Nothing_to_escape';
10 10
(...skipping 28 matching lines...) Expand all
39 39
40 Expect.equals(expected, buffer.toString()); 40 Expect.equals(expected, buffer.toString());
41 } 41 }
42 42
43 void _testConvert(HtmlEscape escape, String input, String expected) { 43 void _testConvert(HtmlEscape escape, String input, String expected) {
44 var output = escape.convert(input); 44 var output = escape.convert(input);
45 Expect.equals(expected, output); 45 Expect.equals(expected, output);
46 } 46 }
47 47
48 void _testTransform(HtmlEscape escape, String input, String expected) { 48 void _testTransform(HtmlEscape escape, String input, String expected) {
49 var controller = new StreamController(sync: true); 49 var controller = new StreamController<String>(sync: true);
50 50
51 var stream = controller.stream.transform(escape); 51 var stream = controller.stream.transform(escape);
52 52
53 var done = false; 53 var done = false;
54 int count = 0; 54 int count = 0;
55 55
56 void stringData(value) { 56 void stringData(value) {
57 Expect.equals(expected, value); 57 Expect.equals(expected, value);
58 count++; 58 count++;
59 } 59 }
(...skipping 19 matching lines...) Expand all
79 79
80 void main() { 80 void main() {
81 _testMode(HTML_ESCAPE, _TEST_INPUT, _OUTPUT_UNKNOWN); 81 _testMode(HTML_ESCAPE, _TEST_INPUT, _OUTPUT_UNKNOWN);
82 _testMode(const HtmlEscape(), _TEST_INPUT, _OUTPUT_UNKNOWN); 82 _testMode(const HtmlEscape(), _TEST_INPUT, _OUTPUT_UNKNOWN);
83 _testMode(const HtmlEscape(HtmlEscapeMode.UNKNOWN), _TEST_INPUT, _OUTPUT_UNKNO WN); 83 _testMode(const HtmlEscape(HtmlEscapeMode.UNKNOWN), _TEST_INPUT, _OUTPUT_UNKNO WN);
84 _testMode(const HtmlEscape(HtmlEscapeMode.ATTRIBUTE), _TEST_INPUT, _OUTPUT_ATT RIBUTE); 84 _testMode(const HtmlEscape(HtmlEscapeMode.ATTRIBUTE), _TEST_INPUT, _OUTPUT_ATT RIBUTE);
85 _testMode(const HtmlEscape(HtmlEscapeMode.SQ_ATTRIBUTE), _TEST_INPUT, _OUTPUT_ SQ_ATTRIBUTE); 85 _testMode(const HtmlEscape(HtmlEscapeMode.SQ_ATTRIBUTE), _TEST_INPUT, _OUTPUT_ SQ_ATTRIBUTE);
86 _testMode(const HtmlEscape(HtmlEscapeMode.ELEMENT), _TEST_INPUT, _OUTPUT_ELEME NT); 86 _testMode(const HtmlEscape(HtmlEscapeMode.ELEMENT), _TEST_INPUT, _OUTPUT_ELEME NT);
87 _testMode(HTML_ESCAPE, _NOOP, _NOOP); 87 _testMode(HTML_ESCAPE, _NOOP, _NOOP);
88 } 88 }
OLDNEW
« no previous file with comments | « test/codegen/lib/convert/codec2_test.dart ('k') | tool/input_sdk/lib/convert/ascii.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698