diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/paste/tests/ui | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/paste/tests/ui')
28 files changed, 243 insertions, 0 deletions
diff --git a/third_party/rust/paste/tests/ui/case-warning.rs b/third_party/rust/paste/tests/ui/case-warning.rs new file mode 100644 index 0000000000..fdea4d619d --- /dev/null +++ b/third_party/rust/paste/tests/ui/case-warning.rs @@ -0,0 +1,15 @@ +#![deny(warnings)] + +use paste::paste; + +macro_rules! m { + ($i:ident) => { + paste! { + pub fn [<foo $i>]() {} + } + }; +} + +m!(Bar); + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/case-warning.stderr b/third_party/rust/paste/tests/ui/case-warning.stderr new file mode 100644 index 0000000000..83099129df --- /dev/null +++ b/third_party/rust/paste/tests/ui/case-warning.stderr @@ -0,0 +1,16 @@ +error: function `fooBar` should have a snake case name + --> tests/ui/case-warning.rs:8:20 + | +8 | pub fn [<foo $i>]() {} + | ^^^^^^^^^^ help: convert the identifier to snake case: `foo_bar` +... +13 | m!(Bar); + | ------- in this macro invocation + | +note: the lint level is defined here + --> tests/ui/case-warning.rs:1:9 + | +1 | #![deny(warnings)] + | ^^^^^^^^ + = note: `#[deny(non_snake_case)]` implied by `#[deny(warnings)]` + = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/paste/tests/ui/env-empty.rs b/third_party/rust/paste/tests/ui/env-empty.rs new file mode 100644 index 0000000000..1e9f2d0a24 --- /dev/null +++ b/third_party/rust/paste/tests/ui/env-empty.rs @@ -0,0 +1,7 @@ +use paste::paste; + +paste! { + fn [<env!()>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/env-empty.stderr b/third_party/rust/paste/tests/ui/env-empty.stderr new file mode 100644 index 0000000000..a1ef2e2f58 --- /dev/null +++ b/third_party/rust/paste/tests/ui/env-empty.stderr @@ -0,0 +1,5 @@ +error: expected string literal as argument to env! macro + --> tests/ui/env-empty.rs:4:10 + | +4 | fn [<env!()>]() {} + | ^^^^^^ diff --git a/third_party/rust/paste/tests/ui/env-non-string.rs b/third_party/rust/paste/tests/ui/env-non-string.rs new file mode 100644 index 0000000000..55255ef902 --- /dev/null +++ b/third_party/rust/paste/tests/ui/env-non-string.rs @@ -0,0 +1,7 @@ +use paste::paste; + +paste! { + fn [<env!(1.31)>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/env-non-string.stderr b/third_party/rust/paste/tests/ui/env-non-string.stderr new file mode 100644 index 0000000000..05b8deba83 --- /dev/null +++ b/third_party/rust/paste/tests/ui/env-non-string.stderr @@ -0,0 +1,5 @@ +error: expected string literal + --> tests/ui/env-non-string.rs:4:15 + | +4 | fn [<env!(1.31)>]() {} + | ^^^^ diff --git a/third_party/rust/paste/tests/ui/env-suffix.rs b/third_party/rust/paste/tests/ui/env-suffix.rs new file mode 100644 index 0000000000..b5c60af450 --- /dev/null +++ b/third_party/rust/paste/tests/ui/env-suffix.rs @@ -0,0 +1,7 @@ +use paste::paste; + +paste! { + fn [<env!("VAR"suffix)>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/env-suffix.stderr b/third_party/rust/paste/tests/ui/env-suffix.stderr new file mode 100644 index 0000000000..d723cbc7ed --- /dev/null +++ b/third_party/rust/paste/tests/ui/env-suffix.stderr @@ -0,0 +1,5 @@ +error: expected string literal + --> tests/ui/env-suffix.rs:4:15 + | +4 | fn [<env!("VAR"suffix)>]() {} + | ^^^^^^^^^^^ diff --git a/third_party/rust/paste/tests/ui/env-unexpected.rs b/third_party/rust/paste/tests/ui/env-unexpected.rs new file mode 100644 index 0000000000..39cb770d98 --- /dev/null +++ b/third_party/rust/paste/tests/ui/env-unexpected.rs @@ -0,0 +1,7 @@ +use paste::paste; + +paste! { + fn [<env!("VAR" "VAR")>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/env-unexpected.stderr b/third_party/rust/paste/tests/ui/env-unexpected.stderr new file mode 100644 index 0000000000..25387b1140 --- /dev/null +++ b/third_party/rust/paste/tests/ui/env-unexpected.stderr @@ -0,0 +1,5 @@ +error: unexpected token in env! macro + --> tests/ui/env-unexpected.rs:4:21 + | +4 | fn [<env!("VAR" "VAR")>]() {} + | ^^^^^ diff --git a/third_party/rust/paste/tests/ui/invalid-ident.rs b/third_party/rust/paste/tests/ui/invalid-ident.rs new file mode 100644 index 0000000000..6a8cf3c44b --- /dev/null +++ b/third_party/rust/paste/tests/ui/invalid-ident.rs @@ -0,0 +1,15 @@ +use paste::paste; + +paste! { + fn [<0 f>]() {} +} + +paste! { + fn [<f '"'>]() {} +} + +paste! { + fn [<f "'">]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/invalid-ident.stderr b/third_party/rust/paste/tests/ui/invalid-ident.stderr new file mode 100644 index 0000000000..28593fb1a6 --- /dev/null +++ b/third_party/rust/paste/tests/ui/invalid-ident.stderr @@ -0,0 +1,21 @@ +error: expected identifier, found `0f` + --> tests/ui/invalid-ident.rs:3:1 + | +3 | / paste! { +4 | | fn [<0 f>]() {} +5 | | } + | |_^ expected identifier + | + = note: this error originates in the macro `paste` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: `"f\""` is not a valid identifier + --> tests/ui/invalid-ident.rs:8:8 + | +8 | fn [<f '"'>]() {} + | ^^^^^^^^^ + +error: `"f'"` is not a valid identifier + --> tests/ui/invalid-ident.rs:12:8 + | +12 | fn [<f "'">]() {} + | ^^^^^^^^^ diff --git a/third_party/rust/paste/tests/ui/missing-paren-on-env.rs b/third_party/rust/paste/tests/ui/missing-paren-on-env.rs new file mode 100644 index 0000000000..44fefbd3e0 --- /dev/null +++ b/third_party/rust/paste/tests/ui/missing-paren-on-env.rs @@ -0,0 +1,7 @@ +use paste::paste; + +paste! { + fn [<env! huh>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/missing-paren-on-env.stderr b/third_party/rust/paste/tests/ui/missing-paren-on-env.stderr new file mode 100644 index 0000000000..7b4bc4604d --- /dev/null +++ b/third_party/rust/paste/tests/ui/missing-paren-on-env.stderr @@ -0,0 +1,5 @@ +error: expected `(` + --> tests/ui/missing-paren-on-env.rs:4:15 + | +4 | fn [<env! huh>]() {} + | ^^^ diff --git a/third_party/rust/paste/tests/ui/no-env-var.rs b/third_party/rust/paste/tests/ui/no-env-var.rs new file mode 100644 index 0000000000..c6d8c3d59c --- /dev/null +++ b/third_party/rust/paste/tests/ui/no-env-var.rs @@ -0,0 +1,7 @@ +use paste::paste; + +paste! { + fn [<a env!("PASTE_UNKNOWN") b>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/no-env-var.stderr b/third_party/rust/paste/tests/ui/no-env-var.stderr new file mode 100644 index 0000000000..60de9ede26 --- /dev/null +++ b/third_party/rust/paste/tests/ui/no-env-var.stderr @@ -0,0 +1,5 @@ +error: no such env var: "PASTE_UNKNOWN" + --> tests/ui/no-env-var.rs:4:17 + | +4 | fn [<a env!("PASTE_UNKNOWN") b>]() {} + | ^^^^^^^^^^^^^^^ diff --git a/third_party/rust/paste/tests/ui/no-ident-after-colon.rs b/third_party/rust/paste/tests/ui/no-ident-after-colon.rs new file mode 100644 index 0000000000..50b3b0dd01 --- /dev/null +++ b/third_party/rust/paste/tests/ui/no-ident-after-colon.rs @@ -0,0 +1,7 @@ +use paste::paste; + +paste! { + fn [<name:0>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/no-ident-after-colon.stderr b/third_party/rust/paste/tests/ui/no-ident-after-colon.stderr new file mode 100644 index 0000000000..9db91eb517 --- /dev/null +++ b/third_party/rust/paste/tests/ui/no-ident-after-colon.stderr @@ -0,0 +1,5 @@ +error: expected identifier after `:` + --> tests/ui/no-ident-after-colon.rs:4:15 + | +4 | fn [<name:0>]() {} + | ^ diff --git a/third_party/rust/paste/tests/ui/unexpected-group.rs b/third_party/rust/paste/tests/ui/unexpected-group.rs new file mode 100644 index 0000000000..63ee5161c7 --- /dev/null +++ b/third_party/rust/paste/tests/ui/unexpected-group.rs @@ -0,0 +1,7 @@ +use paste::paste; + +paste! { + fn [<a {} b>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/unexpected-group.stderr b/third_party/rust/paste/tests/ui/unexpected-group.stderr new file mode 100644 index 0000000000..f66f5c15e0 --- /dev/null +++ b/third_party/rust/paste/tests/ui/unexpected-group.stderr @@ -0,0 +1,5 @@ +error: unexpected token + --> tests/ui/unexpected-group.rs:4:12 + | +4 | fn [<a {} b>]() {} + | ^^ diff --git a/third_party/rust/paste/tests/ui/unexpected-modifier.rs b/third_party/rust/paste/tests/ui/unexpected-modifier.rs new file mode 100644 index 0000000000..99fe68f1ff --- /dev/null +++ b/third_party/rust/paste/tests/ui/unexpected-modifier.rs @@ -0,0 +1,7 @@ +use paste::paste; + +paste! { + fn [<:lower x>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/unexpected-modifier.stderr b/third_party/rust/paste/tests/ui/unexpected-modifier.stderr new file mode 100644 index 0000000000..1eaba3147a --- /dev/null +++ b/third_party/rust/paste/tests/ui/unexpected-modifier.stderr @@ -0,0 +1,5 @@ +error: unexpected modifier + --> tests/ui/unexpected-modifier.rs:4:10 + | +4 | fn [<:lower x>]() {} + | ^^^^^^ diff --git a/third_party/rust/paste/tests/ui/unexpected-punct.rs b/third_party/rust/paste/tests/ui/unexpected-punct.rs new file mode 100644 index 0000000000..d0edb9243a --- /dev/null +++ b/third_party/rust/paste/tests/ui/unexpected-punct.rs @@ -0,0 +1,7 @@ +use paste::paste; + +paste! { + fn [<a + b>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/unexpected-punct.stderr b/third_party/rust/paste/tests/ui/unexpected-punct.stderr new file mode 100644 index 0000000000..1a74a61d73 --- /dev/null +++ b/third_party/rust/paste/tests/ui/unexpected-punct.stderr @@ -0,0 +1,5 @@ +error: unexpected punct + --> tests/ui/unexpected-punct.rs:4:12 + | +4 | fn [<a + b>]() {} + | ^ diff --git a/third_party/rust/paste/tests/ui/unsupported-literal.rs b/third_party/rust/paste/tests/ui/unsupported-literal.rs new file mode 100644 index 0000000000..7a9c490d8c --- /dev/null +++ b/third_party/rust/paste/tests/ui/unsupported-literal.rs @@ -0,0 +1,21 @@ +use paste::paste; + +paste! { + fn [<x 1e+100 z>]() {} +} + +paste! { + // `xyz` is not correct. `xbyz` is certainly not correct. Maybe `x121z` + // would be justifiable but for now don't accept this. + fn [<x b'y' z>]() {} +} + +paste! { + fn [<x b"y" z>]() {} +} + +paste! { + fn [<x br"y" z>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/unsupported-literal.stderr b/third_party/rust/paste/tests/ui/unsupported-literal.stderr new file mode 100644 index 0000000000..a802b4580f --- /dev/null +++ b/third_party/rust/paste/tests/ui/unsupported-literal.stderr @@ -0,0 +1,23 @@ +error: unsupported literal + --> tests/ui/unsupported-literal.rs:4:12 + | +4 | fn [<x 1e+100 z>]() {} + | ^^^^^^ + +error: unsupported literal + --> tests/ui/unsupported-literal.rs:10:12 + | +10 | fn [<x b'y' z>]() {} + | ^^^^ + +error: unsupported literal + --> tests/ui/unsupported-literal.rs:14:12 + | +14 | fn [<x b"y" z>]() {} + | ^^^^ + +error: unsupported literal + --> tests/ui/unsupported-literal.rs:18:12 + | +18 | fn [<x br"y" z>]() {} + | ^^^^^ diff --git a/third_party/rust/paste/tests/ui/unsupported-modifier.rs b/third_party/rust/paste/tests/ui/unsupported-modifier.rs new file mode 100644 index 0000000000..a65b36ae80 --- /dev/null +++ b/third_party/rust/paste/tests/ui/unsupported-modifier.rs @@ -0,0 +1,7 @@ +use paste::paste; + +paste! { + fn [<a:pillow>]() {} +} + +fn main() {} diff --git a/third_party/rust/paste/tests/ui/unsupported-modifier.stderr b/third_party/rust/paste/tests/ui/unsupported-modifier.stderr new file mode 100644 index 0000000000..3c7043541f --- /dev/null +++ b/third_party/rust/paste/tests/ui/unsupported-modifier.stderr @@ -0,0 +1,5 @@ +error: unsupported modifier + --> tests/ui/unsupported-modifier.rs:4:11 + | +4 | fn [<a:pillow>]() {} + | ^^^^^^^ |