|
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 | File "test.ml", line 15, characters 6-24: |
8 | 8 | Unexpected tag '@canonical' at this location. |
9 | 9 |
|
10 | | -Test__x has a 'canonical' field: |
| 10 | +Test_x has a 'canonical' field: |
11 | 11 |
|
12 | | - $ odoc_print test__x.odocl | jq -c ".canonical" |
| 12 | + $ odoc_print test_x.odocl | jq -c ".canonical" |
13 | 13 | {"Some":{"`Dot":[{"`Root":"Test"},"X"]}} |
14 | 14 |
|
15 | | -The alias Test.X should be marked as canonical: |
| 15 | +The first two type declarations should have resolved canonical constructors, the third should not |
| 16 | + |
| 17 | + $ odoc_print test.odocl | jq -c ".content.Module.items | .[] | .Type[1] | select(.) | .equation.manifest.Some.Constr" |
| 18 | + [{"`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"]}},[]] |
| 19 | + [{"`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"]}},[]] |
| 20 | + [{"`Resolved":{"`Type":[{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"Test_z"]}},"t"]}},[]] |
16 | 21 |
|
17 | | - $ odoc_print test.odocl | jq -c ".content.Module.items | .[] | .Module[1].type_.Alias[0] | select(.)" |
18 | | - {"`Resolved":{"`Canonical":[{"`Hidden":{"`Identifier":{"`Root":[{"`RootPage":"test"},"Test__x"]}}},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"X"]}}}]}} |
19 | | - {"`Resolved":{"`Canonical":[{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"Test__y"]}},{"`Resolved":{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"Y"]}}}]}} |
20 | | - {"`Resolved":{"`Hidden":{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"Test__z"]}}}} |
|
0 commit comments