OLD | NEW |
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 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import "package:async_helper/async_helper.dart"; | 9 import "package:async_helper/async_helper.dart"; |
10 import "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
11 | 11 |
12 void testZLibInflate_regress10026() { | 12 void testZLibInflate_regress10026() { |
13 test(data, expect) { | 13 test(data, expect) { |
14 asyncStart(); | 14 asyncStart(); |
15 var controller = new StreamController(sync: true); | 15 var controller = new StreamController(sync: true); |
16 controller.stream | 16 controller.stream |
17 .transform(ZLIB.decoder) | 17 .transform(ZLIB.decoder) |
18 .transform(UTF8.decoder) | 18 .transform(UTF8.decoder) |
19 .fold(new StringBuffer(), (buffer, s) { | 19 .fold(new StringBuffer(), (buffer, s) { |
20 buffer.write(s); | 20 buffer.write(s); |
21 return buffer; | 21 return buffer; |
22 }) | 22 }).then((out) { |
23 .then((out) { | 23 Expect.equals(out.toString(), expect); |
24 Expect.equals(out.toString(), expect); | 24 asyncEnd(); |
25 asyncEnd(); | 25 }); |
26 }); | |
27 controller.add(data); | 26 controller.add(data); |
28 controller.close(); | 27 controller.close(); |
29 } | 28 } |
| 29 |
30 // Generated by using 'gzip -c | od -v -tu1 -An -w12' and adding commas. | 30 // Generated by using 'gzip -c | od -v -tu1 -An -w12' and adding commas. |
31 test([ | 31 test( |
32 31, 139, 8, 8, 238, 42, 167, 81, 0, 3, 116, 101, | 32 [ |
33 120, 116, 46, 116, 120, 116, 0, 125, 84, 79, 175, 147, | 33 31, |
34 64, 16, 63, 183, 159, 98, 196, 139, 38, 165, 244, 249, | 34 139, |
35 212, 52, 20, 136, 70, 77, 188, 168, 7, 189, 120, 156, | 35 8, |
36 178, 67, 153, 20, 118, 113, 119, 161, 109, 140, 223, 221, | 36 8, |
37 97, 105, 251, 170, 47, 154, 54, 41, 51, 195, 254, 254, | 37 238, |
38 49, 52, 123, 162, 76, 233, 79, 29, 65, 237, 219, 166, | 38 42, |
39 152, 103, 151, 31, 66, 85, 204, 103, 153, 103, 223, 80, | 39 167, |
40 241, 225, 136, 109, 215, 16, 188, 55, 45, 178, 206, 146, | 40 81, |
41 169, 59, 151, 121, 75, 30, 161, 172, 209, 58, 242, 121, | 41 0, |
42 212, 251, 42, 94, 71, 144, 20, 151, 73, 237, 125, 23, | 42 3, |
43 211, 143, 158, 135, 60, 122, 103, 180, 39, 237, 227, 145, | 43 116, |
44 45, 130, 114, 170, 242, 200, 211, 209, 39, 35, 235, 230, | 44 101, |
45 138, 243, 8, 70, 99, 75, 121, 52, 48, 29, 58, 99, | 45 120, |
46 253, 205, 225, 3, 43, 95, 231, 138, 6, 46, 41, 14, | 46 116, |
47 197, 2, 88, 179, 103, 108, 98, 87, 98, 67, 249, 221, | 47 46, |
48 25, 199, 249, 147, 24, 24, 185, 207, 148, 165, 115, 145, | 48 116, |
49 12, 182, 70, 157, 224, 231, 124, 54, 219, 98, 185, 223, | 49 120, |
50 89, 211, 107, 21, 151, 166, 49, 54, 133, 167, 213, 74, | 50 116, |
51 62, 47, 54, 50, 108, 209, 238, 88, 167, 176, 26, 139, | 51 0, |
52 14, 149, 98, 189, 59, 87, 149, 104, 137, 43, 108, 185, | 52 125, |
53 57, 165, 16, 125, 233, 72, 195, 87, 212, 46, 90, 64, | 53 84, |
54 244, 145, 154, 129, 60, 151, 8, 159, 169, 39, 233, 92, | 54 79, |
55 27, 11, 120, 107, 69, 227, 2, 156, 220, 26, 59, 178, | 55 175, |
56 92, 109, 36, 206, 95, 243, 153, 226, 33, 200, 9, 102, | 56 147, |
57 82, 120, 189, 90, 117, 199, 91, 5, 175, 168, 5, 236, | 57 64, |
58 189, 249, 67, 200, 61, 181, 155, 127, 88, 168, 170, 48, | 58 16, |
59 49, 86, 145, 141, 45, 42, 238, 93, 10, 119, 225, 126, | 59 63, |
60 97, 195, 180, 97, 189, 95, 0, 166, 3, 59, 246, 164, | 60 183, |
61 2, 247, 229, 240, 253, 250, 229, 122, 29, 206, 143, 137, | 61 159, |
62 197, 138, 74, 99, 209, 179, 17, 25, 218, 104, 154, 32, | 62 98, |
63 222, 180, 164, 24, 225, 89, 139, 199, 248, 86, 244, 243, | 63 196, |
64 41, 213, 75, 188, 255, 17, 39, 32, 87, 219, 23, 223, | 64 139, |
65 23, 139, 15, 201, 63, 180, 254, 50, 19, 158, 194, 67, | 65 38, |
66 22, 147, 183, 17, 84, 190, 89, 18, 158, 187, 44, 116, | 66 165, |
67 50, 109, 244, 60, 27, 21, 73, 45, 132, 227, 90, 212, | 67 244, |
68 119, 143, 150, 91, 90, 50, 232, 138, 111, 53, 59, 80, | 68 249, |
69 161, 9, 114, 69, 206, 227, 182, 97, 87, 75, 72, 222, | 69 212, |
70 192, 150, 160, 119, 114, 89, 25, 11, 220, 52, 189, 243, | 70 52, |
71 99, 52, 3, 1, 77, 112, 78, 246, 80, 78, 151, 125, | 71 20, |
72 43, 139, 234, 150, 240, 221, 244, 82, 74, 110, 30, 52, | 72 136, |
73 5, 136, 16, 180, 88, 97, 141, 158, 64, 96, 208, 237, | 73 70, |
74 3, 92, 71, 182, 101, 231, 36, 231, 145, 72, 88, 192, | 74 77, |
75 223, 74, 209, 87, 10, 121, 110, 90, 1, 251, 81, 222, | 75 188, |
76 8, 140, 3, 114, 35, 34, 105, 132, 17, 120, 75, 59, | 76 168, |
77 158, 116, 25, 189, 204, 146, 110, 242, 149, 201, 107, 105, | 77 7, |
78 169, 202, 163, 241, 229, 76, 147, 228, 112, 56, 44, 25, | 78 189, |
79 53, 46, 141, 221, 37, 19, 137, 75, 92, 71, 165, 44, | 79 120, |
80 104, 84, 124, 50, 150, 132, 83, 0, 219, 9, 103, 41, | 80 156, |
81 72, 88, 4, 180, 44, 9, 41, 102, 201, 57, 211, 100, | 81 178, |
82 250, 243, 248, 13, 215, 32, 235, 247, 84, 4, 0, 0 | 82 67, |
83 ], ''' | 83 153, |
| 84 20, |
| 85 118, |
| 86 113, |
| 87 119, |
| 88 161, |
| 89 109, |
| 90 140, |
| 91 223, |
| 92 221, |
| 93 97, |
| 94 105, |
| 95 251, |
| 96 170, |
| 97 47, |
| 98 154, |
| 99 54, |
| 100 41, |
| 101 51, |
| 102 195, |
| 103 254, |
| 104 254, |
| 105 49, |
| 106 52, |
| 107 123, |
| 108 162, |
| 109 76, |
| 110 233, |
| 111 79, |
| 112 29, |
| 113 65, |
| 114 237, |
| 115 219, |
| 116 166, |
| 117 152, |
| 118 103, |
| 119 151, |
| 120 31, |
| 121 66, |
| 122 85, |
| 123 204, |
| 124 103, |
| 125 153, |
| 126 103, |
| 127 223, |
| 128 80, |
| 129 241, |
| 130 225, |
| 131 136, |
| 132 109, |
| 133 215, |
| 134 16, |
| 135 188, |
| 136 55, |
| 137 45, |
| 138 178, |
| 139 206, |
| 140 146, |
| 141 169, |
| 142 59, |
| 143 151, |
| 144 121, |
| 145 75, |
| 146 30, |
| 147 161, |
| 148 172, |
| 149 209, |
| 150 58, |
| 151 242, |
| 152 121, |
| 153 212, |
| 154 251, |
| 155 42, |
| 156 94, |
| 157 71, |
| 158 144, |
| 159 20, |
| 160 151, |
| 161 73, |
| 162 237, |
| 163 125, |
| 164 23, |
| 165 211, |
| 166 143, |
| 167 158, |
| 168 135, |
| 169 60, |
| 170 122, |
| 171 103, |
| 172 180, |
| 173 39, |
| 174 237, |
| 175 227, |
| 176 145, |
| 177 45, |
| 178 130, |
| 179 114, |
| 180 170, |
| 181 242, |
| 182 200, |
| 183 211, |
| 184 209, |
| 185 39, |
| 186 35, |
| 187 235, |
| 188 230, |
| 189 138, |
| 190 243, |
| 191 8, |
| 192 70, |
| 193 99, |
| 194 75, |
| 195 121, |
| 196 52, |
| 197 48, |
| 198 29, |
| 199 58, |
| 200 99, |
| 201 253, |
| 202 205, |
| 203 225, |
| 204 3, |
| 205 43, |
| 206 95, |
| 207 231, |
| 208 138, |
| 209 6, |
| 210 46, |
| 211 41, |
| 212 14, |
| 213 197, |
| 214 2, |
| 215 88, |
| 216 179, |
| 217 103, |
| 218 108, |
| 219 98, |
| 220 87, |
| 221 98, |
| 222 67, |
| 223 249, |
| 224 221, |
| 225 25, |
| 226 199, |
| 227 249, |
| 228 147, |
| 229 24, |
| 230 24, |
| 231 185, |
| 232 207, |
| 233 148, |
| 234 165, |
| 235 115, |
| 236 145, |
| 237 12, |
| 238 182, |
| 239 70, |
| 240 157, |
| 241 224, |
| 242 231, |
| 243 124, |
| 244 54, |
| 245 219, |
| 246 98, |
| 247 185, |
| 248 223, |
| 249 89, |
| 250 211, |
| 251 107, |
| 252 21, |
| 253 151, |
| 254 166, |
| 255 49, |
| 256 54, |
| 257 133, |
| 258 167, |
| 259 213, |
| 260 74, |
| 261 62, |
| 262 47, |
| 263 54, |
| 264 50, |
| 265 108, |
| 266 209, |
| 267 238, |
| 268 88, |
| 269 167, |
| 270 176, |
| 271 26, |
| 272 139, |
| 273 14, |
| 274 149, |
| 275 98, |
| 276 189, |
| 277 59, |
| 278 87, |
| 279 149, |
| 280 104, |
| 281 137, |
| 282 43, |
| 283 108, |
| 284 185, |
| 285 57, |
| 286 165, |
| 287 16, |
| 288 125, |
| 289 233, |
| 290 72, |
| 291 195, |
| 292 87, |
| 293 212, |
| 294 46, |
| 295 90, |
| 296 64, |
| 297 244, |
| 298 145, |
| 299 154, |
| 300 129, |
| 301 60, |
| 302 151, |
| 303 8, |
| 304 159, |
| 305 169, |
| 306 39, |
| 307 233, |
| 308 92, |
| 309 27, |
| 310 11, |
| 311 120, |
| 312 107, |
| 313 69, |
| 314 227, |
| 315 2, |
| 316 156, |
| 317 220, |
| 318 26, |
| 319 59, |
| 320 178, |
| 321 92, |
| 322 109, |
| 323 36, |
| 324 206, |
| 325 95, |
| 326 243, |
| 327 153, |
| 328 226, |
| 329 33, |
| 330 200, |
| 331 9, |
| 332 102, |
| 333 82, |
| 334 120, |
| 335 189, |
| 336 90, |
| 337 117, |
| 338 199, |
| 339 91, |
| 340 5, |
| 341 175, |
| 342 168, |
| 343 5, |
| 344 236, |
| 345 189, |
| 346 249, |
| 347 67, |
| 348 200, |
| 349 61, |
| 350 181, |
| 351 155, |
| 352 127, |
| 353 88, |
| 354 168, |
| 355 170, |
| 356 48, |
| 357 49, |
| 358 86, |
| 359 145, |
| 360 141, |
| 361 45, |
| 362 42, |
| 363 238, |
| 364 93, |
| 365 10, |
| 366 119, |
| 367 225, |
| 368 126, |
| 369 97, |
| 370 195, |
| 371 180, |
| 372 97, |
| 373 189, |
| 374 95, |
| 375 0, |
| 376 166, |
| 377 3, |
| 378 59, |
| 379 246, |
| 380 164, |
| 381 2, |
| 382 247, |
| 383 229, |
| 384 240, |
| 385 253, |
| 386 250, |
| 387 229, |
| 388 122, |
| 389 29, |
| 390 206, |
| 391 143, |
| 392 137, |
| 393 197, |
| 394 138, |
| 395 74, |
| 396 99, |
| 397 209, |
| 398 179, |
| 399 17, |
| 400 25, |
| 401 218, |
| 402 104, |
| 403 154, |
| 404 32, |
| 405 222, |
| 406 180, |
| 407 164, |
| 408 24, |
| 409 225, |
| 410 89, |
| 411 139, |
| 412 199, |
| 413 248, |
| 414 86, |
| 415 244, |
| 416 243, |
| 417 41, |
| 418 213, |
| 419 75, |
| 420 188, |
| 421 255, |
| 422 17, |
| 423 39, |
| 424 32, |
| 425 87, |
| 426 219, |
| 427 23, |
| 428 223, |
| 429 23, |
| 430 139, |
| 431 15, |
| 432 201, |
| 433 63, |
| 434 180, |
| 435 254, |
| 436 50, |
| 437 19, |
| 438 158, |
| 439 194, |
| 440 67, |
| 441 22, |
| 442 147, |
| 443 183, |
| 444 17, |
| 445 84, |
| 446 190, |
| 447 89, |
| 448 18, |
| 449 158, |
| 450 187, |
| 451 44, |
| 452 116, |
| 453 50, |
| 454 109, |
| 455 244, |
| 456 60, |
| 457 27, |
| 458 21, |
| 459 73, |
| 460 45, |
| 461 132, |
| 462 227, |
| 463 90, |
| 464 212, |
| 465 119, |
| 466 143, |
| 467 150, |
| 468 91, |
| 469 90, |
| 470 50, |
| 471 232, |
| 472 138, |
| 473 111, |
| 474 53, |
| 475 59, |
| 476 80, |
| 477 161, |
| 478 9, |
| 479 114, |
| 480 69, |
| 481 206, |
| 482 227, |
| 483 182, |
| 484 97, |
| 485 87, |
| 486 75, |
| 487 72, |
| 488 222, |
| 489 192, |
| 490 150, |
| 491 160, |
| 492 119, |
| 493 114, |
| 494 89, |
| 495 25, |
| 496 11, |
| 497 220, |
| 498 52, |
| 499 189, |
| 500 243, |
| 501 99, |
| 502 52, |
| 503 3, |
| 504 1, |
| 505 77, |
| 506 112, |
| 507 78, |
| 508 246, |
| 509 80, |
| 510 78, |
| 511 151, |
| 512 125, |
| 513 43, |
| 514 139, |
| 515 234, |
| 516 150, |
| 517 240, |
| 518 221, |
| 519 244, |
| 520 82, |
| 521 74, |
| 522 110, |
| 523 30, |
| 524 52, |
| 525 5, |
| 526 136, |
| 527 16, |
| 528 180, |
| 529 88, |
| 530 97, |
| 531 141, |
| 532 158, |
| 533 64, |
| 534 96, |
| 535 208, |
| 536 237, |
| 537 3, |
| 538 92, |
| 539 71, |
| 540 182, |
| 541 101, |
| 542 231, |
| 543 36, |
| 544 231, |
| 545 145, |
| 546 72, |
| 547 88, |
| 548 192, |
| 549 223, |
| 550 74, |
| 551 209, |
| 552 87, |
| 553 10, |
| 554 121, |
| 555 110, |
| 556 90, |
| 557 1, |
| 558 251, |
| 559 81, |
| 560 222, |
| 561 8, |
| 562 140, |
| 563 3, |
| 564 114, |
| 565 35, |
| 566 34, |
| 567 105, |
| 568 132, |
| 569 17, |
| 570 120, |
| 571 75, |
| 572 59, |
| 573 158, |
| 574 116, |
| 575 25, |
| 576 189, |
| 577 204, |
| 578 146, |
| 579 110, |
| 580 242, |
| 581 149, |
| 582 201, |
| 583 107, |
| 584 105, |
| 585 169, |
| 586 202, |
| 587 163, |
| 588 241, |
| 589 229, |
| 590 76, |
| 591 147, |
| 592 228, |
| 593 112, |
| 594 56, |
| 595 44, |
| 596 25, |
| 597 53, |
| 598 46, |
| 599 141, |
| 600 221, |
| 601 37, |
| 602 19, |
| 603 137, |
| 604 75, |
| 605 92, |
| 606 71, |
| 607 165, |
| 608 44, |
| 609 104, |
| 610 84, |
| 611 124, |
| 612 50, |
| 613 150, |
| 614 132, |
| 615 83, |
| 616 0, |
| 617 219, |
| 618 9, |
| 619 103, |
| 620 41, |
| 621 72, |
| 622 88, |
| 623 4, |
| 624 180, |
| 625 44, |
| 626 9, |
| 627 41, |
| 628 102, |
| 629 201, |
| 630 57, |
| 631 211, |
| 632 100, |
| 633 250, |
| 634 243, |
| 635 248, |
| 636 13, |
| 637 215, |
| 638 32, |
| 639 235, |
| 640 247, |
| 641 84, |
| 642 4, |
| 643 0, |
| 644 0 |
| 645 ], |
| 646 ''' |
84 <!doctype html> | 647 <!doctype html> |
85 <html> | 648 <html> |
86 <head> | 649 <head> |
87 <title>Example Domain</title> | 650 <title>Example Domain</title> |
88 | 651 |
89 <meta charset="utf-8" /> | 652 <meta charset="utf-8" /> |
90 <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | 653 <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> |
91 <meta name="viewport" content="width=device-width, initial-scale=1" /> | 654 <meta name="viewport" content="width=device-width, initial-scale=1" /> |
92 <style type="text/css"> | 655 <style type="text/css"> |
93 body { | 656 body { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 <p><a href="http://www.iana.org/domains/special">More information...</a>
</p> | 694 <p><a href="http://www.iana.org/domains/special">More information...</a>
</p> |
132 </div> | 695 </div> |
133 </body> | 696 </body> |
134 </html> | 697 </html> |
135 '''); | 698 '''); |
136 } | 699 } |
137 | 700 |
138 void main() { | 701 void main() { |
139 testZLibInflate_regress10026(); | 702 testZLibInflate_regress10026(); |
140 } | 703 } |
141 | |
OLD | NEW |