|
1 | 1 | Test that @canonical tags work on compilation units when it is placed in the |
2 | 2 | top-comment. |
3 | 3 |
|
4 | | -The module Test__X is expected to be referenced through Test.X. |
| 4 | +The module Test_X is expected to be referenced through Test.X. |
5 | 5 |
|
6 | | - $ compile test__x.mli test.ml |
| 6 | + $ compile test_x.mli test.ml |
7 | 7 |
|
8 | | -Test__x has a 'canonical' field: |
| 8 | +Test_x has a 'canonical' field: |
9 | 9 |
|
10 | | - $ odoc_print test__x.odocl | jq -c ".canonical" |
| 10 | + $ odoc_print test_x.odocl | jq -c ".canonical" |
11 | 11 | {"Some":{"`Dot":[{"`Root":"Test"},"X"]}} |
12 | 12 |
|
13 | | -The alias Test.X should be marked as canonical: |
| 13 | +The first two type declarations should have resolved canonical constructors, the third should not |
| 14 | + |
| 15 | + $ odoc_print test.odocl | jq -c ".content.Module.items | .[] | .Type[1] | select(.) | .equation.manifest.Some.Constr" |
| 16 | + [{"`Resolved":{"`Type":[{"`Canonical":[{"`Identifier":{"`Root":[{"`RootPage":"test"},"Test_x"]}},{"`Resolved":{"`Alias":[{"`Identifier":{"`Root":[{"`RootPage":"test"},"Test_x"]}},{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"X"]}}]}}]},"t"]}},[]] |
| 17 | + [{"`Resolved":{"`Type":[{"`Canonical":[{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"Test_y"]}},{"`Resolved":{"`Alias":[{"`Canonical":[{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"Test_y"]}},{"`Dot":[{"`Root":"Test"},"Y"]}]},{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"Y"]}}]}}]},"t"]}},[]] |
| 18 | + [{"`Resolved":{"`Type":[{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"Test_z"]}},"t"]}},[]] |
14 | 19 |
|
15 | | - $ odoc_print test.odocl | jq -c ".content.Module.items | .[] | .Module[1].type_.Alias[0] | select(.)" |
16 | | - {"`Resolved":{"`Canonical":[{"`Hidden":{"`Identifier":{"`Root":[{"`RootPage":"test"},"Test__x"]}}},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"X"]}}}]}} |
17 | | - {"`Resolved":{"`Canonical":[{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"Test__y"]}},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"Y"]}}}]}} |
18 | | - {"`Resolved":{"`Hidden":{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"Test__z"]}}}} |
|
0 commit comments