jsfmt.spec.js.snap 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`comments.js 1`] = `
  3. switch (true) {
  4. case true:
  5. // Good luck getting here
  6. case false:
  7. }
  8. switch (true) {
  9. case true:
  10. // Good luck getting here
  11. case false:
  12. }
  13. switch(x) {
  14. case x: {
  15. }
  16. // other
  17. case y: {
  18. }
  19. }
  20. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  21. switch (true) {
  22. case true:
  23. // Good luck getting here
  24. case false:
  25. }
  26. switch (true) {
  27. case true:
  28. // Good luck getting here
  29. case false:
  30. }
  31. switch (x) {
  32. case x: {
  33. }
  34. // other
  35. case y: {
  36. }
  37. }
  38. `;
  39. exports[`empty_lines.js 1`] = `
  40. switch (foo) {
  41. case "bar":
  42. doSomething();
  43. case "baz":
  44. doOtherThing();
  45. }
  46. switch (foo) {
  47. case "bar":
  48. doSomething();
  49. case "baz":
  50. doOtherThing();
  51. }
  52. switch (foo) {
  53. case "bar":
  54. doSomething();
  55. case "baz":
  56. doOtherThing();
  57. }
  58. switch (foo) {
  59. case "bar":
  60. doSomething();
  61. case "baz":
  62. doOtherThing();
  63. }
  64. switch (x) {
  65. case y:
  66. call();
  67. break;
  68. case z:
  69. call();
  70. break;
  71. }
  72. switch (a) {
  73. case b:
  74. if (1) {};
  75. c;
  76. }
  77. switch (a) {
  78. case x:
  79. case y:
  80. call();
  81. case z:
  82. call();
  83. }
  84. switch (a) {
  85. case x: case y:
  86. call();
  87. case z:
  88. call();
  89. }
  90. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  91. switch (foo) {
  92. case "bar":
  93. doSomething();
  94. case "baz":
  95. doOtherThing();
  96. }
  97. switch (foo) {
  98. case "bar":
  99. doSomething();
  100. case "baz":
  101. doOtherThing();
  102. }
  103. switch (foo) {
  104. case "bar":
  105. doSomething();
  106. case "baz":
  107. doOtherThing();
  108. }
  109. switch (foo) {
  110. case "bar":
  111. doSomething();
  112. case "baz":
  113. doOtherThing();
  114. }
  115. switch (x) {
  116. case y:
  117. call();
  118. break;
  119. case z:
  120. call();
  121. break;
  122. }
  123. switch (a) {
  124. case b:
  125. if (1) {
  126. }
  127. c;
  128. }
  129. switch (a) {
  130. case x:
  131. case y:
  132. call();
  133. case z:
  134. call();
  135. }
  136. switch (a) {
  137. case x:
  138. case y:
  139. call();
  140. case z:
  141. call();
  142. }
  143. `;
  144. exports[`empty_statement.js 1`] = `
  145. switch (error.code) {
  146. case ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION: {
  147. nls.localize('errorInvalidConfiguration', "Unable to write into settings. Correct errors/warnings in the file and try again.");
  148. };
  149. }
  150. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  151. switch (error.code) {
  152. case ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION: {
  153. nls.localize(
  154. "errorInvalidConfiguration",
  155. "Unable to write into settings. Correct errors/warnings in the file and try again."
  156. );
  157. }
  158. }
  159. `;
  160. exports[`empty_switch.js 1`] = `
  161. switch (1) { default:; }
  162. switch (1) {}
  163. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  164. switch (1) {
  165. default:
  166. }
  167. switch (1) {
  168. }
  169. `;
  170. exports[`switch.js 1`] = `
  171. switch (a) {
  172. case 3:
  173. alert( '3' );
  174. break;
  175. case 4:
  176. alert( '4' );
  177. break;
  178. case 5:
  179. alert( '5' );
  180. break;
  181. default:
  182. alert( 'default' );
  183. }
  184. switch (veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong) {
  185. case 3:
  186. alert( '3' );
  187. break;
  188. default:
  189. alert( 'default' );
  190. }
  191. switch (veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong > veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong) {
  192. case 3:
  193. alert( '3' );
  194. break;
  195. default:
  196. alert( 'default' );
  197. }
  198. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  199. switch (a) {
  200. case 3:
  201. alert("3");
  202. break;
  203. case 4:
  204. alert("4");
  205. break;
  206. case 5:
  207. alert("5");
  208. break;
  209. default:
  210. alert("default");
  211. }
  212. switch (
  213. veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong
  214. ) {
  215. case 3:
  216. alert("3");
  217. break;
  218. default:
  219. alert("default");
  220. }
  221. switch (
  222. veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong >
  223. veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong
  224. ) {
  225. case 3:
  226. alert("3");
  227. break;
  228. default:
  229. alert("default");
  230. }
  231. `;