|
| 1 | +// Jest Snapshot v1, https://goo.gl/fbAQLP |
| 2 | + |
| 3 | +exports[`logical_expression_operators.js 1`] = ` |
| 4 | +====================================options===================================== |
| 5 | +parsers: ["babel", "flow", "typescript"] |
| 6 | +printWidth: 80 |
| 7 | + | printWidth |
| 8 | +=====================================input====================================== |
| 9 | +// Same operators do not require parens |
| 10 | +(foo && bar) && baz; |
| 11 | +foo && (bar && baz); |
| 12 | +foo && ((bar && baz) && qux); |
| 13 | +foo && (bar && (baz && qux)); |
| 14 | +foo && (bar && ((baz && qux) && xyz)); |
| 15 | +foo && (bar && (baz && (qux && xyz))); |
| 16 | +
|
| 17 | +(foo || bar) || baz; |
| 18 | +foo || (bar || baz); |
| 19 | +foo || ((bar || baz) || qux); |
| 20 | +foo || (bar || (baz || qux)); |
| 21 | +foo || (bar || ((baz || qux) || xyz)); |
| 22 | +foo || (bar || (baz || (qux || xyz))); |
| 23 | +
|
| 24 | +(foo ?? bar) ?? baz; |
| 25 | +foo ?? (bar ?? baz); |
| 26 | +foo ?? ((bar ?? baz) ?? qux); |
| 27 | +foo ?? (bar ?? (baz ?? qux)); |
| 28 | +foo ?? (bar ?? ((baz ?? qux) ?? xyz)); |
| 29 | +foo ?? (bar ?? (baz ?? (qux ?? xyz))); |
| 30 | +
|
| 31 | +// Explicitly parenthesized && and || requires parens |
| 32 | +(foo && bar) || baz; |
| 33 | +(foo || bar) && baz; |
| 34 | +
|
| 35 | +foo && (bar || baz); |
| 36 | +foo || (bar && baz); |
| 37 | +
|
| 38 | +// Implicitly parenthesized && and || requires parens |
| 39 | +foo && bar || baz; |
| 40 | +foo || bar && baz; |
| 41 | +
|
| 42 | +=====================================output===================================== |
| 43 | +// Same operators do not require parens |
| 44 | +foo && bar && baz; |
| 45 | +foo && bar && baz; |
| 46 | +foo && bar && baz && qux; |
| 47 | +foo && bar && baz && qux; |
| 48 | +foo && bar && baz && qux && xyz; |
| 49 | +foo && bar && baz && qux && xyz; |
| 50 | +
|
| 51 | +foo || bar || baz; |
| 52 | +foo || bar || baz; |
| 53 | +foo || bar || baz || qux; |
| 54 | +foo || bar || baz || qux; |
| 55 | +foo || bar || baz || qux || xyz; |
| 56 | +foo || bar || baz || qux || xyz; |
| 57 | +
|
| 58 | +foo ?? bar ?? baz; |
| 59 | +foo ?? bar ?? baz; |
| 60 | +foo ?? bar ?? baz ?? qux; |
| 61 | +foo ?? bar ?? baz ?? qux; |
| 62 | +foo ?? bar ?? baz ?? qux ?? xyz; |
| 63 | +foo ?? bar ?? baz ?? qux ?? xyz; |
| 64 | +
|
| 65 | +// Explicitly parenthesized && and || requires parens |
| 66 | +(foo && bar) || baz; |
| 67 | +(foo || bar) && baz; |
| 68 | +
|
| 69 | +foo && (bar || baz); |
| 70 | +foo || (bar && baz); |
| 71 | +
|
| 72 | +// Implicitly parenthesized && and || requires parens |
| 73 | +(foo && bar) || baz; |
| 74 | +foo || (bar && baz); |
| 75 | +
|
| 76 | +================================================================================ |
| 77 | +`; |
0 commit comments