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 | |
| parent | 9c7f31870b4e1bf37df79ebbe1df9a56df83d878 (diff) | |
Basic package management
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/compiler/hint.typ | 10 | ||||
| -rw-r--r-- | tests/typ/compiler/packages.typ | 64 | ||||
| -rw-r--r-- | tests/typ/visualize/image.typ | 4 |
3 files changed, 73 insertions, 5 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": * diff --git a/tests/typ/visualize/image.typ b/tests/typ/visualize/image.typ index dc5b2ef6..7891e7e2 100644 --- a/tests/typ/visualize/image.typ +++ b/tests/typ/visualize/image.typ @@ -54,9 +54,9 @@ A #box(image("/tiger.jpg", height: 1cm, width: 80%)) B #image("path/does/not/exist") --- -// Error: 8-21 unknown image format +// Error: 2-22 unknown image format #image("./image.typ") --- -// Error: 8-18 failed to parse svg: found closing tag 'g' instead of 'style' in line 4 +// Error: 2-19 failed to parse svg: found closing tag 'g' instead of 'style' in line 4 #image("/bad.svg") |
