Move tests that only checks first error to subfolder
[hiphop-php.git] / hphp / hack / test / typecheck / reactive / only_first_error / test_rx_enabled2.php
blob56ff917774afdf1129865bfdc8b43599f388191d
1 <?hh // strict
3 <<__Rx>>
4 function f1(): int {
5 if (HH\Rx\IS_ENABLED) {
6 return rx();
7 } else {
8 return nonrx();
12 <<__Rx>>
13 function f2(): int {
14 return HH\Rx\IS_ENABLED ? rx() : nonrx();
18 // ======== RxShallow ========
19 <<__RxShallow>>
20 function f3(): int {
21 if (HH\Rx\IS_ENABLED) {
22 return rx() + rxshallow();
23 } else {
24 return nonrx();
28 <<__RxShallow>>
29 function f4(): int {
30 return HH\Rx\IS_ENABLED ? rx() + rxshallow() : nonrx();
33 // ======== RxLocal ========
34 <<__RxLocal>>
35 function f5(): int {
36 if (HH\Rx\IS_ENABLED) {
37 return rx();
38 } else {
39 return nonrx();
43 <<__RxLocal>>
44 function f6(): int {
45 return HH\Rx\IS_ENABLED ? rx() : nonrx();
48 <<__Rx>>
49 function f7(): int {
50 invariant(HH\Rx\IS_ENABLED, "Host with Rx support expected.");
51 return rx();
54 <<__Rx>>
55 function f8(): int {
56 invariant(!HH\Rx\IS_ENABLED, "Host with Rx support not expected.");
57 return nonrx();
60 <<__Rx>>
61 function f9(): int {
62 if (HH\Rx\IS_ENABLED) {
63 return 0;
65 return nonrx();
68 <<__Rx>>
69 function f10(): int {
70 if (!HH\Rx\IS_ENABLED) {
71 return nonrx();
73 return rx();
76 <<__Rx>>
77 function rx(): int {
78 return 1;
81 <<__RxShallow>>
82 function rxshallow(): int {
83 return 1;
86 function nonrx(): int {
87 return 1;