Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 8d3ba46

Browse files
committed
snapshot tests
1 parent 1565905 commit 8d3ba46

File tree

9 files changed

+92
-92
lines changed

9 files changed

+92
-92
lines changed

tests/parsing/errors/expressions/__snapshots__/parse.spec.js.snap

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let x = ((let a = 1 in let b = 2 in fun pattern -> (\\"test\\" : int))
77
[@ns.braces ])
88
=====Errors=============================================
99
10-
File \\"/napkinscript/tests/parsing/errors/expressions/ambiguousArrow.js\\", line 1, characters 8-21:
10+
File \\"/syntax/tests/parsing/errors/expressions/ambiguousArrow.js\\", line 1, characters 8-21:
1111
1212
1313
1 │ let a = b:int => \\"hi\\"
@@ -20,7 +20,7 @@ Did you mean to annotate the parameter type or the return type?
2020
2121
2222
23-
File \\"/napkinscript/tests/parsing/errors/expressions/ambiguousArrow.js\\", line 6, characters 2-23:
23+
File \\"/syntax/tests/parsing/errors/expressions/ambiguousArrow.js\\", line 6, characters 2-23:
2424
2525
2626
4let a = 1
@@ -43,7 +43,7 @@ exports[`array.js 1`] = `
4343
let xs = x.map (fun key -> [|key;(predicates.(key))|])
4444
=====Errors=============================================
4545
46-
File \\"/napkinscript/tests/parsing/errors/expressions/array.js\\", line 2, characters 43-44:
46+
File \\"/syntax/tests/parsing/errors/expressions/array.js\\", line 2, characters 43-44:
4747
4848
4949
1 │ // missing ] before )
@@ -64,7 +64,7 @@ exports[`arrow.js 1`] = `
6464
fun providerId -> ((let x = 1 in let b = 2 in x + b)[@ns.braces ]))
6565
=====Errors=============================================
6666
67-
File \\"/napkinscript/tests/parsing/errors/expressions/arrow.js\\", line 1, characters 51-52:
67+
File \\"/syntax/tests/parsing/errors/expressions/arrow.js\\", line 1, characters 51-52:
6868
6969
7070
1 │ Object.keys(providers).reduce((elements, providerId] => {
@@ -105,7 +105,7 @@ let pipeline =
105105
match scheduler with | Some -> [%napkinscript.exprhole ] | None -> ()
106106
=====Errors=============================================
107107
108-
File \\"/napkinscript/tests/parsing/errors/expressions/block.js\\", line 14, characters 3-5:
108+
File \\"/syntax/tests/parsing/errors/expressions/block.js\\", line 14, characters 3-5:
109109
110110
111111
12 │
@@ -118,7 +118,7 @@ File \\"/napkinscript/tests/parsing/errors/expressions/block.js\\", line 14, cha
118118
Did you forget a \`)\` here?
119119
120120
121-
File \\"/napkinscript/tests/parsing/errors/expressions/block.js\\", line 18, characters 24-26:
121+
File \\"/syntax/tests/parsing/errors/expressions/block.js\\", line 18, characters 24-26:
122122
123123
124124
16 │
@@ -131,7 +131,7 @@ File \\"/napkinscript/tests/parsing/errors/expressions/block.js\\", line 18, cha
131131
Did you forget a \`)\` here?
132132
133133
134-
File \\"/napkinscript/tests/parsing/errors/expressions/block.js\\", line 22, characters 10-12:
134+
File \\"/syntax/tests/parsing/errors/expressions/block.js\\", line 22, characters 10-12:
135135
136136
137137
20 │
@@ -143,7 +143,7 @@ File \\"/napkinscript/tests/parsing/errors/expressions/block.js\\", line 22, cha
143143
Looks like there might be an expression missing here
144144
145145
146-
File \\"/napkinscript/tests/parsing/errors/expressions/block.js\\", line 26, characters 6-8:
146+
File \\"/syntax/tests/parsing/errors/expressions/block.js\\", line 26, characters 6-8:
147147
148148
149149
24| Join(doc1, doc2) =>
@@ -156,7 +156,7 @@ File \\"/napkinscript/tests/parsing/errors/expressions/block.js\\", line 26, cha
156156
Did you forget a \`)\` here?
157157
158158
159-
File \\"/napkinscript/tests/parsing/errors/expressions/block.js\\", line 30, characters 9-11:
159+
File \\"/syntax/tests/parsing/errors/expressions/block.js\\", line 30, characters 9-11:
160160
161161
162162
28 │
@@ -181,7 +181,7 @@ let () = ((sideEffect1 (); sideEffect2 ())[@ns.braces ])
181181
let () = ((let open Foo in let exception End in x ())[@ns.braces ])
182182
=====Errors=============================================
183183
184-
File \\"/napkinscript/tests/parsing/errors/expressions/consecutive.ns\\", line 1, characters 22-23:
184+
File \\"/syntax/tests/parsing/errors/expressions/consecutive.ns\\", line 1, characters 22-23:
185185
186186
187187
1 │ let f = (a,b) => a + 3b;
@@ -191,7 +191,7 @@ File \\"/napkinscript/tests/parsing/errors/expressions/consecutive.ns\\", line 1
191191
consecutive statements on a line must be separated by ';' or a newline
192192
193193
194-
File \\"/napkinscript/tests/parsing/errors/expressions/consecutive.ns\\", line 4, characters 6-7:
194+
File \\"/syntax/tests/parsing/errors/expressions/consecutive.ns\\", line 4, characters 6-7:
195195
196196
197197
2
@@ -203,7 +203,7 @@ File \\"/napkinscript/tests/parsing/errors/expressions/consecutive.ns\\", line 4
203203
consecutive expressions on a line must be separated by ';' or a newline
204204
205205
206-
File \\"/napkinscript/tests/parsing/errors/expressions/consecutive.ns\\", line 8, characters 15-27:
206+
File \\"/syntax/tests/parsing/errors/expressions/consecutive.ns\\", line 8, characters 15-27:
207207
208208
209209
6
@@ -215,7 +215,7 @@ File \\"/napkinscript/tests/parsing/errors/expressions/consecutive.ns\\", line 8
215215
consecutive expressions on a line must be separated by ';' or a newline
216216
217217
218-
File \\"/napkinscript/tests/parsing/errors/expressions/consecutive.ns\\", line 12, characters 10-20:
218+
File \\"/syntax/tests/parsing/errors/expressions/consecutive.ns\\", line 12, characters 10-20:
219219
220220
221221
10
@@ -237,7 +237,7 @@ let x = ((())[@ns.braces ])
237237
let f a b = ((())[@ns.braces ])
238238
=====Errors=============================================
239239
240-
File \\"/napkinscript/tests/parsing/errors/expressions/emptyBlock.js\\", line 1, characters 9-10:
240+
File \\"/syntax/tests/parsing/errors/expressions/emptyBlock.js\\", line 1, characters 9-10:
241241
242242
243243
1 │ let x = {}
@@ -247,7 +247,7 @@ File \\"/napkinscript/tests/parsing/errors/expressions/emptyBlock.js\\", line 1,
247247
This let-binding misses an expression
248248
249249
250-
File \\"/napkinscript/tests/parsing/errors/expressions/emptyBlock.js\\", line 3, characters 19-20:
250+
File \\"/syntax/tests/parsing/errors/expressions/emptyBlock.js\\", line 3, characters 19-20:
251251
252252
253253
1let x = {}
@@ -266,7 +266,7 @@ exports[`if.js 1`] = `
266266
;;if match then let a = 1 in a + 1
267267
=====Errors=============================================
268268
269-
File \\"/napkinscript/tests/parsing/errors/expressions/if.js\\", line 2, characters 10-16:
269+
File \\"/syntax/tests/parsing/errors/expressions/if.js\\", line 2, characters 10-16:
270270
271271
272272
1 │ // missing brace below
@@ -287,7 +287,7 @@ exports[`misc.js 1`] = `
287287
let x = ([%napkinscript.exprhole ]) + 1
288288
=====Errors=============================================
289289
290-
File \\"/napkinscript/tests/parsing/errors/expressions/misc.js\\", line 1, characters 8-9:
290+
File \\"/syntax/tests/parsing/errors/expressions/misc.js\\", line 1, characters 8-9:
291291
292292
293293
1 │ let x = _ + 1
@@ -306,7 +306,7 @@ let newWrapper = { updateF; updateF2; value = (f xWrapper.currentValue) }
306306
let record = { field = ([%napkinscript.exprhole ]) }
307307
=====Errors=============================================
308308
309-
File \\"/napkinscript/tests/parsing/errors/expressions/record.js\\", line 2, characters 9-17:
309+
File \\"/syntax/tests/parsing/errors/expressions/record.js\\", line 2, characters 9-17:
310310
311311
312312
1 │ let newWrapper = {
@@ -318,7 +318,7 @@ File \\"/napkinscript/tests/parsing/errors/expressions/record.js\\", line 2, cha
318318
Did you forget a \`,\` here?
319319
320320
321-
File \\"/napkinscript/tests/parsing/errors/expressions/record.js\\", line 8, characters 9-18:
321+
File \\"/syntax/tests/parsing/errors/expressions/record.js\\", line 8, characters 9-18:
322322
323323
324324
6 │
@@ -331,7 +331,7 @@ File \\"/napkinscript/tests/parsing/errors/expressions/record.js\\", line 8, cha
331331
Did you forget a \`:\` here?
332332
333333
334-
File \\"/napkinscript/tests/parsing/errors/expressions/record.js\\", line 13, characters 8-13:
334+
File \\"/syntax/tests/parsing/errors/expressions/record.js\\", line 13, characters 8-13:
335335
336336
337337
11 │
@@ -355,7 +355,7 @@ exports[`setField.js 1`] = `
355355
else sideEffect ()
356356
=====Errors=============================================
357357
358-
File \\"/napkinscript/tests/parsing/errors/expressions/setField.js\\", line 4, characters 29-31:
358+
File \\"/syntax/tests/parsing/errors/expressions/setField.js\\", line 4, characters 29-31:
359359
360360
361361
2 │ let a = 1
@@ -376,7 +376,7 @@ exports[`taggedTemplateLiterals.js 1`] = `
376376
;;{|null|}
377377
=====Errors=============================================
378378
379-
File \\"/napkinscript/tests/parsing/errors/expressions/taggedTemplateLiterals.js\\", line 1, characters 0-5:
379+
File \\"/syntax/tests/parsing/errors/expressions/taggedTemplateLiterals.js\\", line 1, characters 0-5:
380380
381381
382382
1 │ foo()\`null\`
@@ -393,7 +393,7 @@ exports[`try.js 1`] = `
393393
let parsedPayload = try Js.Json.parseExn response with | _ -> Js.Json.null
394394
=====Errors=============================================
395395
396-
File \\"/napkinscript/tests/parsing/errors/expressions/try.js\\", line 2, characters 36-38:
396+
File \\"/syntax/tests/parsing/errors/expressions/try.js\\", line 2, characters 36-38:
397397
398398
399399
1 │ let parsedPayload =
@@ -415,7 +415,7 @@ let x = ((let a = 1 in let b = 2 in (a + b : int))[@ns.braces ])
415415
let x = (\\"hi\\" : string)
416416
=====Errors=============================================
417417
418-
File \\"/napkinscript/tests/parsing/errors/expressions/unexpectedConstraint.js\\", line 4, characters 2-13:
418+
File \\"/syntax/tests/parsing/errors/expressions/unexpectedConstraint.js\\", line 4, characters 2-13:
419419
420420
421421
2 │ let a = 1
@@ -429,7 +429,7 @@ Expressions with type constraints need to be wrapped in parens:
429429
430430
431431
432-
File \\"/napkinscript/tests/parsing/errors/expressions/unexpectedConstraint.js\\", line 7, characters 8-20:
432+
File \\"/syntax/tests/parsing/errors/expressions/unexpectedConstraint.js\\", line 7, characters 8-20:
433433
434434
435435
5 │ }

tests/parsing/errors/other/__snapshots__/parse.spec.js.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`patternMatching.js 1`] = `
55
;;match expr with
66
=====Errors=============================================
77
8-
File \\"/napkinscript/tests/parsing/errors/other/patternMatching.js\\", line 1, characters 13-15:
8+
File \\"/syntax/tests/parsing/errors/other/patternMatching.js\\", line 1, characters 13-15:
99
1010
1111
1 │ switch expr {
@@ -28,7 +28,7 @@ let myList = x :: y
2828
let x::y = myList
2929
=====Errors=============================================
3030
31-
File \\"/napkinscript/tests/parsing/errors/other/spread.js\\", line 1, characters 11-14:
31+
File \\"/syntax/tests/parsing/errors/other/spread.js\\", line 1, characters 11-14:
3232
3333
3434
1 │ let arr = [...x, ...y]
@@ -38,7 +38,7 @@ File \\"/napkinscript/tests/parsing/errors/other/spread.js\\", line 1, character
3838
Arrays can't use the \`...\` spread currently. Please use \`concat\` or other Array helpers.
3939
4040
41-
File \\"/napkinscript/tests/parsing/errors/other/spread.js\\", line 2, characters 5-8:
41+
File \\"/syntax/tests/parsing/errors/other/spread.js\\", line 2, characters 5-8:
4242
4343
4444
1 │ let arr = [...x, ...y]
@@ -51,7 +51,7 @@ Explanation: such spread would create a subarray; out of performance concern, ou
5151
Solution: if it's to validate the first few elements, use a \`when\` clause + Array size check + \`get\` checks on the current pattern. If it's to obtain a subarray, use \`Array.sub\` or \`Belt.Array.slice\`.
5252
5353
54-
File \\"/napkinscript/tests/parsing/errors/other/spread.js\\", line 4, characters 20-23:
54+
File \\"/syntax/tests/parsing/errors/other/spread.js\\", line 4, characters 20-23:
5555
5656
5757
2 │ let [...arr, _] = [1, 2, 3]
@@ -64,7 +64,7 @@ Records can only have one \`...\` spread, at the beginning.
6464
Explanation: since records have a known, fixed shape, a spread like \`{a, ...b}\` wouldn't make sense, as \`b\` would override every field of \`a\` anyway.
6565
6666
67-
File \\"/napkinscript/tests/parsing/errors/other/spread.js\\", line 5, characters 14-18:
67+
File \\"/syntax/tests/parsing/errors/other/spread.js\\", line 5, characters 14-18:
6868
6969
7070
3 │
@@ -78,7 +78,7 @@ Explanation: you can't collect a subset of a record's field into its own record,
7878
Solution: you need to pull out each field you want explicitly.
7979
8080
81-
File \\"/napkinscript/tests/parsing/errors/other/spread.js\\", line 8, characters 12-22:
81+
File \\"/syntax/tests/parsing/errors/other/spread.js\\", line 8, characters 12-22:
8282
8383
8484
6

tests/parsing/errors/scanner/__snapshots__/parse.spec.js.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let x = \\"\\\\\\\\0\\"
66
let x = \\"\\\\\\\\0AAA\\"
77
=====Errors=============================================
88
9-
File \\"/napkinscript/tests/parsing/errors/scanner/escapeSequence.js\\", line 1, characters 9-11:
9+
File \\"/syntax/tests/parsing/errors/scanner/escapeSequence.js\\", line 1, characters 9-11:
1010
1111
1212
1 │ let x = \\"\\\\0\\"
@@ -16,7 +16,7 @@ File \\"/napkinscript/tests/parsing/errors/scanner/escapeSequence.js\\", line 1,
1616
unknown escape sequence
1717
1818
19-
File \\"/napkinscript/tests/parsing/errors/scanner/escapeSequence.js\\", line 3, characters 9-11:
19+
File \\"/syntax/tests/parsing/errors/scanner/escapeSequence.js\\", line 3, characters 9-11:
2020
2121
2222
1 │ let x = \\"\\\\0\\"
@@ -36,7 +36,7 @@ let newVelocity = velocity +. (a *. secondPerFrame)
3636
let newX = x +. (newVelocity *. secondPerFrame)
3737
=====Errors=============================================
3838
39-
File \\"/napkinscript/tests/parsing/errors/scanner/oldDerefOp.js\\", line 1, characters 49-50:
39+
File \\"/syntax/tests/parsing/errors/scanner/oldDerefOp.js\\", line 1, characters 49-50:
4040
4141
4242
1 │ let newVelocity = velocity +. a *. secondPerFrame^;
@@ -46,7 +46,7 @@ Hmm, not sure what I should do here with this character.
4646
If you're trying to deref an expression, use \`foo.contents\` instead.
4747
4848
49-
File \\"/napkinscript/tests/parsing/errors/scanner/oldDerefOp.js\\", line 2, characters 45-46:
49+
File \\"/syntax/tests/parsing/errors/scanner/oldDerefOp.js\\", line 2, characters 45-46:
5050
5151
5252
1 │ let newVelocity = velocity +. a *. secondPerFrame^;
@@ -65,7 +65,7 @@ exports[`unclosedComment.js 1`] = `
6565
6666
=====Errors=============================================
6767
68-
File \\"/napkinscript/tests/parsing/errors/scanner/unclosedComment.js\\", line 1, characters 2-18:
68+
File \\"/syntax/tests/parsing/errors/scanner/unclosedComment.js\\", line 1, characters 2-18:
6969
7070
7171
1 │ /* eof
@@ -83,7 +83,7 @@ exports[`unclosedString.js 1`] = `
8383
let z = \\"eof\\"
8484
=====Errors=============================================
8585
86-
File \\"/napkinscript/tests/parsing/errors/scanner/unclosedString.js\\", line 1, characters 9-13:
86+
File \\"/syntax/tests/parsing/errors/scanner/unclosedString.js\\", line 1, characters 9-13:
8787
8888
8989
1 │ let z = \\"eof

tests/parsing/errors/signature/__snapshots__/parse.spec.js.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ val x : int
66
val y : int
77
=====Errors=============================================
88
9-
File \\"/napkinscript/tests/parsing/errors/signature/closingBraces.nsi\\", line 3, characters 0-1:
9+
File \\"/syntax/tests/parsing/errors/signature/closingBraces.nsi\\", line 3, characters 0-1:
1010
1111
1212
1 │ let x: int
@@ -30,7 +30,7 @@ val z1 : int[@@genType ]
3030
val z2 : float[@@genType ]
3131
=====Errors=============================================
3232
33-
File \\"/napkinscript/tests/parsing/errors/signature/consecutive.nsi\\", line 1, characters 10-14:
33+
File \\"/syntax/tests/parsing/errors/signature/consecutive.nsi\\", line 1, characters 10-14:
3434
3535
3636
1 │ let x: int let y: float
@@ -40,7 +40,7 @@ File \\"/napkinscript/tests/parsing/errors/signature/consecutive.nsi\\", line 1,
4040
consecutive specifications on a line must be separated by ';' or a newline
4141
4242
43-
File \\"/napkinscript/tests/parsing/errors/signature/consecutive.nsi\\", line 3, characters 14-21:
43+
File \\"/syntax/tests/parsing/errors/signature/consecutive.nsi\\", line 3, characters 14-21:
4444
4545
4646
1 │ let x: int let y: float

0 commit comments

Comments
 (0)