Skip to content

Commit a40df41

Browse files
committed
add tests
1 parent de20676 commit a40df41

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

tools/tests/src/DocExtractionRes.res

+14
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,18 @@ module M: Example = {
128128
let f = (x: int) => x
129129
}
130130

131+
module type MT = {
132+
let x: int
133+
}
134+
135+
module A: MT = {
136+
let x = 42
137+
}
138+
139+
module C = {
140+
module D: MT = {// generates "moduletypeid": "Example.C.MT" - but should be Example.MT
141+
let x = 42
142+
}
143+
}
144+
131145
// ^dex

tools/tests/src/expected/DocExtractionRes.res.json

+86
Original file line numberDiff line numberDiff line change
@@ -343,5 +343,91 @@
343343
"col": 7
344344
}
345345
}]
346+
},
347+
{
348+
"id": "DocExtractionRes.MT",
349+
"name": "MT",
350+
"kind": "moduleType",
351+
"docstrings": [],
352+
"source": {
353+
"filepath": "src/DocExtractionRes.res",
354+
"line": 131,
355+
"col": 13
356+
},
357+
"items": [
358+
{
359+
"id": "DocExtractionRes.MT.x",
360+
"kind": "value",
361+
"name": "x",
362+
"signature": "let x: int",
363+
"docstrings": [],
364+
"source": {
365+
"filepath": "src/DocExtractionRes.res",
366+
"line": 132,
367+
"col": 3
368+
}
369+
}]
370+
},
371+
{
372+
"id": "DocExtractionRes.A",
373+
"name": "A",
374+
"kind": "module",
375+
"moduletypeid": "DocExtractionRes.MT",
376+
"docstrings": [],
377+
"source": {
378+
"filepath": "src/DocExtractionRes.res",
379+
"line": 1,
380+
"col": 1
381+
},
382+
"items": [
383+
{
384+
"id": "DocExtractionRes.A.x",
385+
"kind": "value",
386+
"name": "x",
387+
"signature": "let x: int",
388+
"docstrings": [],
389+
"source": {
390+
"filepath": "src/DocExtractionRes.res",
391+
"line": 136,
392+
"col": 7
393+
}
394+
}]
395+
},
396+
{
397+
"id": "DocExtractionRes.C",
398+
"name": "C",
399+
"kind": "module",
400+
"docstrings": [],
401+
"source": {
402+
"filepath": "src/DocExtractionRes.res",
403+
"line": 139,
404+
"col": 8
405+
},
406+
"items": [
407+
{
408+
"id": "DocExtractionRes.C.D",
409+
"name": "D",
410+
"kind": "module",
411+
"moduletypeid": "DocExtractionRes.MT",
412+
"docstrings": [],
413+
"source": {
414+
"filepath": "src/DocExtractionRes.res",
415+
"line": 1,
416+
"col": 1
417+
},
418+
"items": [
419+
{
420+
"id": "DocExtractionRes.C.D.x",
421+
"kind": "value",
422+
"name": "x",
423+
"signature": "let x: int",
424+
"docstrings": [],
425+
"source": {
426+
"filepath": "src/DocExtractionRes.res",
427+
"line": 141,
428+
"col": 9
429+
}
430+
}]
431+
}]
346432
}]
347433
}

0 commit comments

Comments
 (0)