diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-06-26 13:57:21 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-06-27 18:40:17 +0200 |
| commit | 7b92bd7c340d9f9c094ed2fa57912049317d9b20 (patch) | |
| tree | b91399526ba94d87309d09d864df2935dd7a4d0a /tests/typ/compiler | |
| parent | 9c7f31870b4e1bf37df79ebbe1df9a56df83d878 (diff) | |
Basic package management
Diffstat (limited to 'tests/typ/compiler')
| -rw-r--r-- | tests/typ/compiler/hint.typ | 10 | ||||
| -rw-r--r-- | tests/typ/compiler/packages.typ | 64 |
2 files changed, 71 insertions, 3 deletions
diff --git a/tests/typ/compiler/hint.typ b/tests/typ/compiler/hint.typ index 19d233d0..fdd5f59b 100644 --- a/tests/typ/compiler/hint.typ +++ b/tests/typ/compiler/hint.typ @@ -1,4 +1,4 @@ -// Test diagnostics. +// Test hints on diagnostics. // Ref: false --- @@ -23,13 +23,17 @@ --- = Heading <intro> + // Error: 1:20-1:26 cannot reference heading without numbering -// Hint: 1:20-1:26 did you mean to use `#set heading(numbering: "1.")`? +// Hint: 1:20-1:26 you can enable heading numbering with `#set heading(numbering: "1.")`? Can not be used as @intro --- +// This test is more of a tooling test. It checks if hint annotation validation +// can be turned off. // Hints: false -// This test is more of a tooling test. It checks if hint annotation validation can be turned off. + = Heading <intro> + // Error: 1:20-1:26 cannot reference heading without numbering Can not be used as @intro diff --git a/tests/typ/compiler/packages.typ b/tests/typ/compiler/packages.typ new file mode 100644 index 00000000..066a31de --- /dev/null +++ b/tests/typ/compiler/packages.typ @@ -0,0 +1,64 @@ +// Test package imports +// Ref: false + +--- +// Test import without items. +#import "@test/adder:0.1.0" +#test(adder.add(2, 8), 10) + +--- +// Test import with items. +#import "@test/adder:0.1.0": add +#test(add(2, 8), 10) + +--- +// Error: 9-13 `@` is not a valid package namespace +#import "@@": * + +--- +// Error: 9-16 package specification is missing name +#import "@heya": * + +--- +// Error: 9-15 `123` is not a valid package namespace +#import "@123": * + +--- +// Error: 9-17 package specification is missing name +#import "@test/": * + +--- +// Error: 9-22 package specification is missing version +#import "@test/mypkg": * + +--- +// Error: 9-20 `$$$` is not a valid package name +#import "@test/$$$": * + +--- +// Error: 9-23 package specification is missing version +#import "@test/mypkg:": * + +--- +// Error: 9-24 version number is missing minor version +#import "@test/mypkg:0": * + +--- +// Error: 9-29 `latest` is not a valid major version +#import "@test/mypkg:latest": * + +--- +// Error: 9-29 `-3` is not a valid major version +#import "@test/mypkg:-3.0.0": * + +--- +// Error: 9-26 version number is missing patch version +#import "@test/mypkg:0.3": * + +--- +// Error: 9-27 version number is missing patch version +#import "@test/mypkg:0.3.": * + +--- +// Error: 9-28 file not found (searched at typ/compiler/#test/mypkg:1.0.0) +#import "#test/mypkg:1.0.0": * |
