1 #include "../test.h" 2 #include "rxcpp/operators/rx-sequence_equal.hpp" 3 4 SCENARIO("sequence_equal - source never emits", "[sequence_equal][operators]"){ 5 GIVEN("two sources"){ 6 auto sc = rxsc::make_test(); 7 auto w = sc.create_worker(); 8 const rxsc::test::messages<int> on; 9 10 auto xs = sc.make_hot_observable({ 11 on.next(150, 1) 12 }); 13 14 auto ys = sc.make_hot_observable({ 15 on.next(150, 1), 16 on.next(200, 2), 17 on.next(300, 3), 18 on.next(400, 4), 19 on.next(500, 5), 20 on.completed(600) 21 }); 22 23 WHEN("two observables are checked for equality"){ 24 25 auto res = w.start( __anon811547630102() 26 [xs, ys]() { 27 return xs 28 | rxo::sequence_equal(ys) 29 | rxo::as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 30 } 31 ); 32 33 THEN("the output is empty"){ 34 auto required = std::vector<rxsc::test::messages<bool>::recorded_type>(); 35 auto actual = res.get_observer().messages(); 36 REQUIRE(required == actual); 37 } 38 39 THEN("there was 1 subscription/unsubscription to the source"){ 40 auto required = rxu::to_vector({ 41 on.subscribe(200, 1000) 42 }); 43 auto actual = xs.subscriptions(); 44 REQUIRE(required == actual); 45 } 46 } 47 } 48 } 49 50 SCENARIO("sequence_equal - other source never emits", "[sequence_equal][operators]"){ 51 GIVEN("two sources"){ 52 auto sc = rxsc::make_test(); 53 auto w = sc.create_worker(); 54 const rxsc::test::messages<int> on; 55 56 auto xs = sc.make_hot_observable({ 57 on.next(150, 1), 58 on.next(210, 2), 59 on.next(310, 3), 60 on.next(410, 4), 61 on.next(510, 5), 62 on.completed(610) 63 }); 64 65 auto ys = sc.make_hot_observable({ 66 on.next(150, 1) 67 }); 68 69 WHEN("two observables are checked for equality"){ 70 71 auto res = w.start( __anon811547630202() 72 [xs, ys]() { 73 return xs 74 .sequence_equal(ys) 75 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 76 } 77 ); 78 79 THEN("the output is empty"){ 80 auto required = std::vector<rxsc::test::messages<bool>::recorded_type>(); 81 auto actual = res.get_observer().messages(); 82 REQUIRE(required == actual); 83 } 84 85 THEN("there was 1 subscription/unsubscription to the source"){ 86 auto required = rxu::to_vector({ 87 on.subscribe(200, 610) 88 }); 89 auto actual = xs.subscriptions(); 90 REQUIRE(required == actual); 91 } 92 } 93 } 94 } 95 96 SCENARIO("sequence_equal - both sources never emit any items", "[sequence_equal][operators]"){ 97 GIVEN("two sources"){ 98 auto sc = rxsc::make_test(); 99 auto w = sc.create_worker(); 100 const rxsc::test::messages<int> on; 101 102 auto xs = sc.make_hot_observable({ 103 on.next(150, 1) 104 }); 105 106 auto ys = sc.make_hot_observable({ 107 on.next(150, 0), 108 }); 109 110 WHEN("two observables are checked for equality"){ 111 112 auto res = w.start( __anon811547630302() 113 [xs, ys]() { 114 return xs 115 .sequence_equal(ys) 116 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 117 } 118 ); 119 120 THEN("the output is empty"){ 121 auto required = std::vector<rxsc::test::messages<bool>::recorded_type>(); 122 auto actual = res.get_observer().messages(); 123 REQUIRE(required == actual); 124 } 125 126 THEN("there was 1 subscription/unsubscription to the source"){ 127 auto required = rxu::to_vector({ 128 on.subscribe(200, 1000) 129 }); 130 auto actual = xs.subscriptions(); 131 REQUIRE(required == actual); 132 } 133 } 134 } 135 } 136 137 SCENARIO("sequence_equal - both sources emit the same sequence of items", "[sequence_equal][operators]"){ 138 GIVEN("two sources"){ 139 auto sc = rxsc::make_test(); 140 auto w = sc.create_worker(); 141 const rxsc::test::messages<int> on; 142 const rxsc::test::messages<bool> o_on; 143 144 auto xs = sc.make_hot_observable({ 145 on.next(150, 1), 146 on.next(210, 2), 147 on.next(310, 3), 148 on.next(410, 4), 149 on.next(510, 5), 150 on.completed(610) 151 }); 152 153 auto ys = sc.make_hot_observable({ 154 on.next(150, 1), 155 on.next(220, 2), 156 on.next(330, 3), 157 on.next(440, 4), 158 on.next(550, 5), 159 on.completed(600) 160 }); 161 162 WHEN("two observables are checked for equality"){ 163 164 auto res = w.start( __anon811547630402() 165 [xs, ys]() { 166 return xs 167 .sequence_equal(ys) 168 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 169 } 170 ); 171 172 THEN("the output contains true"){ 173 auto required = rxu::to_vector({ 174 o_on.next(610, true), 175 o_on.completed(610) 176 }); 177 auto actual = res.get_observer().messages(); 178 REQUIRE(required == actual); 179 } 180 181 THEN("there was 1 subscription/unsubscription to the source"){ 182 auto required = rxu::to_vector({ 183 on.subscribe(200, 610) 184 }); 185 auto actual = xs.subscriptions(); 186 REQUIRE(required == actual); 187 } 188 } 189 } 190 } 191 192 SCENARIO("sequence_equal - first source emits less items than the second one", "[sequence_equal][operators]"){ 193 GIVEN("two sources"){ 194 auto sc = rxsc::make_test(); 195 auto w = sc.create_worker(); 196 const rxsc::test::messages<int> on; 197 const rxsc::test::messages<bool> o_on; 198 199 auto xs = sc.make_hot_observable({ 200 on.next(150, 1), 201 on.next(210, 2), 202 on.next(310, 3), 203 on.next(410, 4), 204 on.completed(610) 205 }); 206 207 auto ys = sc.make_hot_observable({ 208 on.next(150, 1), 209 on.next(220, 2), 210 on.next(330, 3), 211 on.next(440, 4), 212 on.next(550, 5), 213 on.completed(600) 214 }); 215 216 WHEN("two observables are checked for equality"){ 217 218 auto res = w.start( __anon811547630502() 219 [xs, ys]() { 220 return xs 221 .sequence_equal(ys) 222 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 223 } 224 ); 225 226 THEN("the output contains false"){ 227 auto required = rxu::to_vector({ 228 o_on.next(610, false), 229 o_on.completed(610) 230 }); 231 auto actual = res.get_observer().messages(); 232 REQUIRE(required == actual); 233 } 234 235 THEN("there was 1 subscription/unsubscription to the source"){ 236 auto required = rxu::to_vector({ 237 on.subscribe(200, 610) 238 }); 239 auto actual = xs.subscriptions(); 240 REQUIRE(required == actual); 241 } 242 } 243 } 244 } 245 246 SCENARIO("sequence_equal - second source emits less items than the first one", "[sequence_equal][operators]"){ 247 GIVEN("two sources"){ 248 auto sc = rxsc::make_test(); 249 auto w = sc.create_worker(); 250 const rxsc::test::messages<int> on; 251 const rxsc::test::messages<bool> o_on; 252 253 auto xs = sc.make_hot_observable({ 254 on.next(150, 1), 255 on.next(210, 2), 256 on.next(310, 3), 257 on.next(410, 4), 258 on.next(510, 5), 259 on.completed(610) 260 }); 261 262 auto ys = sc.make_hot_observable({ 263 on.next(150, 1), 264 on.next(220, 2), 265 on.next(330, 3), 266 on.next(440, 4), 267 on.completed(600) 268 }); 269 270 WHEN("two observables are checked for equality"){ 271 272 auto res = w.start( __anon811547630602() 273 [xs, ys]() { 274 return xs 275 .sequence_equal(ys) 276 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 277 } 278 ); 279 280 THEN("the output contains false"){ 281 auto required = rxu::to_vector({ 282 o_on.next(610, false), 283 o_on.completed(610) 284 }); 285 auto actual = res.get_observer().messages(); 286 REQUIRE(required == actual); 287 } 288 289 THEN("there was 1 subscription/unsubscription to the source"){ 290 auto required = rxu::to_vector({ 291 on.subscribe(200, 610) 292 }); 293 auto actual = xs.subscriptions(); 294 REQUIRE(required == actual); 295 } 296 } 297 } 298 } 299 300 SCENARIO("sequence_equal - sources emit different sequence of items", "[sequence_equal][operators]"){ 301 GIVEN("two sources"){ 302 auto sc = rxsc::make_test(); 303 auto w = sc.create_worker(); 304 const rxsc::test::messages<int> on; 305 const rxsc::test::messages<bool> o_on; 306 307 auto xs = sc.make_hot_observable({ 308 on.next(150, 1), 309 on.next(210, 2), 310 on.next(310, 9), // 311 on.next(410, 4), 312 on.next(510, 5), 313 on.completed(610) 314 }); 315 316 auto ys = sc.make_hot_observable({ 317 on.next(150, 1), 318 on.next(220, 2), 319 on.next(330, 3), 320 on.next(440, 4), 321 on.next(550, 5), 322 on.completed(600) 323 }); 324 325 WHEN("two observables are checked for equality"){ 326 327 auto res = w.start( __anon811547630702() 328 [xs, ys]() { 329 return xs 330 .sequence_equal(ys) 331 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 332 } 333 ); 334 335 THEN("the output contains false"){ 336 auto required = rxu::to_vector({ 337 o_on.next(330, false), 338 o_on.completed(330) 339 }); 340 auto actual = res.get_observer().messages(); 341 REQUIRE(required == actual); 342 } 343 344 THEN("there was 1 subscription/unsubscription to the source"){ 345 auto required = rxu::to_vector({ 346 on.subscribe(200, 330) 347 }); 348 auto actual = xs.subscriptions(); 349 REQUIRE(required == actual); 350 } 351 } 352 } 353 } 354 355 SCENARIO("sequence_equal - sources emit items in a different order", "[sequence_equal][operators]"){ 356 GIVEN("two sources"){ 357 auto sc = rxsc::make_test(); 358 auto w = sc.create_worker(); 359 const rxsc::test::messages<int> on; 360 const rxsc::test::messages<bool> o_on; 361 362 auto xs = sc.make_hot_observable({ 363 on.next(150, 1), 364 on.next(210, 2), 365 on.next(310, 3), 366 on.next(410, 4), 367 on.next(510, 5), 368 on.completed(610) 369 }); 370 371 auto ys = sc.make_hot_observable({ 372 on.next(150, 1), 373 on.next(220, 2), 374 on.next(330, 4), 375 on.next(440, 3), 376 on.next(550, 5), 377 on.completed(600) 378 }); 379 380 WHEN("two observables are checked for equality"){ 381 382 auto res = w.start( __anon811547630802() 383 [xs, ys]() { 384 return xs 385 .sequence_equal(ys) 386 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 387 } 388 ); 389 390 THEN("the output contains false"){ 391 auto required = rxu::to_vector({ 392 o_on.next(330, false), 393 o_on.completed(330) 394 }); 395 auto actual = res.get_observer().messages(); 396 REQUIRE(required == actual); 397 } 398 399 THEN("there was 1 subscription/unsubscription to the source"){ 400 auto required = rxu::to_vector({ 401 on.subscribe(200, 330) 402 }); 403 auto actual = xs.subscriptions(); 404 REQUIRE(required == actual); 405 } 406 } 407 } 408 } 409 410 SCENARIO("sequence_equal - source observable is empty", "[sequence_equal][operators]"){ 411 GIVEN("two sources"){ 412 auto sc = rxsc::make_test(); 413 auto w = sc.create_worker(); 414 const rxsc::test::messages<int> on; 415 const rxsc::test::messages<bool> o_on; 416 417 auto xs = sc.make_hot_observable({ 418 on.completed(250) 419 }); 420 421 auto ys = sc.make_hot_observable({ 422 on.next(150, 1), 423 on.next(220, 2), 424 on.next(330, 3), 425 on.completed(600) 426 }); 427 428 WHEN("two observables are checked for equality"){ 429 430 auto res = w.start( __anon811547630902() 431 [xs, ys]() { 432 return xs 433 .sequence_equal(ys) 434 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 435 } 436 ); 437 438 THEN("the output contains false"){ 439 auto required = rxu::to_vector({ 440 o_on.next(330, false), 441 o_on.completed(330) 442 }); 443 auto actual = res.get_observer().messages(); 444 REQUIRE(required == actual); 445 } 446 447 THEN("there was 1 subscription/unsubscription to the source"){ 448 auto required = rxu::to_vector({ 449 on.subscribe(200, 250) 450 }); 451 auto actual = xs.subscriptions(); 452 REQUIRE(required == actual); 453 } 454 } 455 } 456 } 457 458 SCENARIO("sequence_equal - other observable is empty", "[sequence_equal][operators]"){ 459 GIVEN("two sources"){ 460 auto sc = rxsc::make_test(); 461 auto w = sc.create_worker(); 462 const rxsc::test::messages<int> on; 463 const rxsc::test::messages<bool> o_on; 464 465 auto xs = sc.make_hot_observable({ 466 on.next(150, 1), 467 on.next(210, 2), 468 on.next(310, 3), 469 on.completed(400) 470 }); 471 472 auto ys = sc.make_hot_observable({ 473 on.completed(250) 474 }); 475 476 WHEN("two observables are checked for equality"){ 477 478 auto res = w.start( __anon811547630a02() 479 [xs, ys]() { 480 return xs 481 .sequence_equal(ys) 482 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 483 } 484 ); 485 486 THEN("the output contains false"){ 487 auto required = rxu::to_vector({ 488 o_on.next(310, false), 489 o_on.completed(310) 490 }); 491 auto actual = res.get_observer().messages(); 492 REQUIRE(required == actual); 493 } 494 495 THEN("there was 1 subscription/unsubscription to the source"){ 496 auto required = rxu::to_vector({ 497 on.subscribe(200, 310) 498 }); 499 auto actual = xs.subscriptions(); 500 REQUIRE(required == actual); 501 } 502 } 503 } 504 } 505 506 SCENARIO("sequence_equal - both observables are empty", "[sequence_equal][operators]"){ 507 GIVEN("two sources"){ 508 auto sc = rxsc::make_test(); 509 auto w = sc.create_worker(); 510 const rxsc::test::messages<int> on; 511 const rxsc::test::messages<bool> o_on; 512 513 auto xs = sc.make_hot_observable({ 514 on.completed(400) 515 }); 516 517 auto ys = sc.make_hot_observable({ 518 on.completed(250) 519 }); 520 521 WHEN("two observables are checked for equality"){ 522 523 auto res = w.start( __anon811547630b02() 524 [xs, ys]() { 525 return xs 526 .sequence_equal(ys) 527 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 528 } 529 ); 530 531 THEN("the output contains false"){ 532 auto required = rxu::to_vector({ 533 o_on.next(400, true), 534 o_on.completed(400) 535 }); 536 auto actual = res.get_observer().messages(); 537 REQUIRE(required == actual); 538 } 539 540 THEN("there was 1 subscription/unsubscription to the source"){ 541 auto required = rxu::to_vector({ 542 on.subscribe(200, 400) 543 }); 544 auto actual = xs.subscriptions(); 545 REQUIRE(required == actual); 546 } 547 } 548 } 549 } 550 551 SCENARIO("sequence_equal - source observable emits an error", "[sequence_equal][operators]"){ 552 GIVEN("two sources"){ 553 auto sc = rxsc::make_test(); 554 auto w = sc.create_worker(); 555 const rxsc::test::messages<int> on; 556 const rxsc::test::messages<bool> o_on; 557 558 std::runtime_error ex("sequence_equal error"); 559 560 auto xs = sc.make_hot_observable({ 561 on.next(150, 1), 562 on.error(250, ex) 563 }); 564 565 auto ys = sc.make_hot_observable({ 566 on.next(150, 1), 567 on.next(220, 2), 568 on.next(550, 5), 569 on.completed(600) 570 }); 571 572 WHEN("two observables are checked for equality"){ 573 574 auto res = w.start( __anon811547630c02() 575 [xs, ys]() { 576 return xs 577 .sequence_equal(ys) 578 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 579 } 580 ); 581 582 THEN("the output contains an error"){ 583 auto required = rxu::to_vector({ 584 o_on.error(250, ex) 585 }); 586 auto actual = res.get_observer().messages(); 587 REQUIRE(required == actual); 588 } 589 590 THEN("there was 1 subscription/unsubscription to the source"){ 591 auto required = rxu::to_vector({ 592 on.subscribe(200, 250) 593 }); 594 auto actual = xs.subscriptions(); 595 REQUIRE(required == actual); 596 } 597 } 598 } 599 } 600 601 SCENARIO("sequence_equal - other observable emits an error", "[sequence_equal][operators]"){ 602 GIVEN("two sources"){ 603 auto sc = rxsc::make_test(); 604 auto w = sc.create_worker(); 605 const rxsc::test::messages<int> on; 606 const rxsc::test::messages<bool> o_on; 607 608 std::runtime_error ex("sequence_equal error"); 609 610 auto xs = sc.make_hot_observable({ 611 on.next(150, 1), 612 on.next(210, 2), 613 on.next(310, 3), 614 on.completed(400) 615 }); 616 617 auto ys = sc.make_hot_observable({ 618 on.next(150, 1), 619 on.error(250, ex) 620 }); 621 622 WHEN("two observables are checked for equality"){ 623 624 auto res = w.start( __anon811547630d02() 625 [xs, ys]() { 626 return xs 627 .sequence_equal(ys) 628 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 629 } 630 ); 631 632 THEN("the output contains an error"){ 633 auto required = rxu::to_vector({ 634 o_on.error(250, ex) 635 }); 636 auto actual = res.get_observer().messages(); 637 REQUIRE(required == actual); 638 } 639 640 THEN("there was 1 subscription/unsubscription to the source"){ 641 auto required = rxu::to_vector({ 642 on.subscribe(200, 250) 643 }); 644 auto actual = xs.subscriptions(); 645 REQUIRE(required == actual); 646 } 647 } 648 } 649 } 650 651 SCENARIO("sequence_equal - both observables emit errors", "[sequence_equal][operators]"){ 652 GIVEN("two sources"){ 653 auto sc = rxsc::make_test(); 654 auto w = sc.create_worker(); 655 const rxsc::test::messages<int> on; 656 const rxsc::test::messages<bool> o_on; 657 658 std::runtime_error ex("sequence_equal error1"); 659 660 auto xs = sc.make_hot_observable({ 661 on.next(150, 1), 662 on.next(210, 2), 663 on.error(250, ex) 664 }); 665 666 auto ys = sc.make_hot_observable({ 667 on.error(300, ex) 668 }); 669 670 WHEN("two observables are checked for equality"){ 671 672 auto res = w.start( __anon811547630e02() 673 [xs, ys]() { 674 return xs 675 .sequence_equal(ys) 676 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 677 } 678 ); 679 680 THEN("the output contains an error"){ 681 auto required = rxu::to_vector({ 682 o_on.error(250, ex) 683 }); 684 auto actual = res.get_observer().messages(); 685 REQUIRE(required == actual); 686 } 687 688 THEN("there was 1 subscription/unsubscription to the source"){ 689 auto required = rxu::to_vector({ 690 on.subscribe(200, 250) 691 }); 692 auto actual = xs.subscriptions(); 693 REQUIRE(required == actual); 694 } 695 } 696 } 697 } 698 699 SCENARIO("sequence_equal - both sources emit the same sequence of items, custom comparing function", "[sequence_equal][operators]"){ 700 GIVEN("two sources"){ 701 auto sc = rxsc::make_test(); 702 auto w = sc.create_worker(); 703 const rxsc::test::messages<int> on; 704 const rxsc::test::messages<bool> o_on; 705 706 auto xs = sc.make_hot_observable({ 707 on.next(150, 1), 708 on.next(210, 2), 709 on.next(310, 3), 710 on.next(410, 4), 711 on.next(510, 5), 712 on.completed(610) 713 }); 714 715 auto ys = sc.make_hot_observable({ 716 on.next(150, 1), 717 on.next(220, 2), 718 on.next(330, 3), 719 on.next(440, 4), 720 on.next(550, 5), 721 on.completed(600) 722 }); 723 724 WHEN("two observables are checked for equality"){ 725 726 auto res = w.start( __anon811547630f02() 727 [xs, ys]() { 728 return xs 729 .sequence_equal(ys, [](int x, int y) { return x == y; }) 730 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 731 } 732 ); 733 734 THEN("the output contains true"){ 735 auto required = rxu::to_vector({ 736 o_on.next(610, true), 737 o_on.completed(610) 738 }); 739 auto actual = res.get_observer().messages(); 740 REQUIRE(required == actual); 741 } 742 743 THEN("there was 1 subscription/unsubscription to the source"){ 744 auto required = rxu::to_vector({ 745 on.subscribe(200, 610) 746 }); 747 auto actual = xs.subscriptions(); 748 REQUIRE(required == actual); 749 } 750 } 751 } 752 } 753 754 SCENARIO("sequence_equal - both sources emit the same sequence of items, custom coordinator", "[sequence_equal][operators]"){ 755 GIVEN("two sources"){ 756 auto sc = rxsc::make_test(); 757 auto w = sc.create_worker(); 758 const rxsc::test::messages<int> on; 759 const rxsc::test::messages<bool> o_on; 760 761 auto xs = sc.make_hot_observable({ 762 on.next(150, 1), 763 on.next(210, 2), 764 on.next(310, 3), 765 on.next(410, 4), 766 on.next(510, 5), 767 on.completed(610) 768 }); 769 770 auto ys = sc.make_hot_observable({ 771 on.next(150, 1), 772 on.next(220, 2), 773 on.next(330, 3), 774 on.next(440, 4), 775 on.next(550, 5), 776 on.completed(600) 777 }); 778 779 WHEN("two observables are checked for equality"){ 780 781 auto res = w.start( __anon811547631102() 782 [xs, ys]() { 783 return xs 784 .sequence_equal(ys, rxcpp::identity_one_worker(rxsc::make_current_thread())) 785 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 786 } 787 ); 788 789 THEN("the output contains true"){ 790 auto required = rxu::to_vector({ 791 o_on.next(610, true), 792 o_on.completed(610) 793 }); 794 auto actual = res.get_observer().messages(); 795 REQUIRE(required == actual); 796 } 797 798 THEN("there was 1 subscription/unsubscription to the source"){ 799 auto required = rxu::to_vector({ 800 on.subscribe(200, 610) 801 }); 802 auto actual = xs.subscriptions(); 803 REQUIRE(required == actual); 804 } 805 } 806 } 807 } 808 809 SCENARIO("sequence_equal - both sources emit the same sequence of items, custom comparing function and coordinator", "[sequence_equal][operators]"){ 810 GIVEN("two sources"){ 811 auto sc = rxsc::make_test(); 812 auto w = sc.create_worker(); 813 const rxsc::test::messages<int> on; 814 const rxsc::test::messages<bool> o_on; 815 816 auto xs = sc.make_hot_observable({ 817 on.next(150, 1), 818 on.next(210, 2), 819 on.next(310, 3), 820 on.next(410, 4), 821 on.next(510, 5), 822 on.completed(610) 823 }); 824 825 auto ys = sc.make_hot_observable({ 826 on.next(150, 1), 827 on.next(220, 2), 828 on.next(330, 3), 829 on.next(440, 4), 830 on.next(550, 5), 831 on.completed(600) 832 }); 833 834 WHEN("two observables are checked for equality"){ 835 836 auto res = w.start( __anon811547631202() 837 [xs, ys]() { 838 return xs 839 .sequence_equal(ys, [](int x, int y) { return x == y; }, rxcpp::identity_one_worker(rxsc::make_current_thread())) 840 .as_dynamic(); // forget type to workaround lambda deduction bug on msvc 2013 841 } 842 ); 843 844 THEN("the output contains true"){ 845 auto required = rxu::to_vector({ 846 o_on.next(610, true), 847 o_on.completed(610) 848 }); 849 auto actual = res.get_observer().messages(); 850 REQUIRE(required == actual); 851 } 852 853 THEN("there was 1 subscription/unsubscription to the source"){ 854 auto required = rxu::to_vector({ 855 on.subscribe(200, 610) 856 }); 857 auto actual = xs.subscriptions(); 858 REQUIRE(required == actual); 859 } 860 } 861 } 862 } 863