Repository: clap-rs/clap
Pull request #5612 (2024-07-31 20:02:19)

test(derive): Update UI tests to stable
<!--
Thanks for helping out!

Please link the appropriate issue from your PR.

If you don't have an issue, we'd recommend starting with one first so the PR can focus on the
implementation (unless its an obvious bug or documentation fix that will have
little conversation).
-->



Patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4116baeb..f56b38e2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -138,7 +138,7 @@ jobs:
     - name: Install Rust
       uses: dtolnay/rust-toolchain@stable
       with:
-        toolchain: "1.74"  # MSRV
+        toolchain: "1.80"  # STABLE
     - uses: Swatinem/rust-cache@v2
     - name: UI Tests
       run: make test-ui-${{ matrix.features }}
diff --git a/Makefile b/Makefile
index febac2ea..fd86e797 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ ifneq (${TOOLCHAIN_TARGET},)
   ARGS+=--target ${TOOLCHAIN_TARGET}
 endif
 
-MSRV?=1.74
+STABLE?=1.80
 
 _FEATURES = minimal default wasm full debug release
 _FEATURES_minimal = --no-default-features --features "std"
@@ -37,7 +37,7 @@ clippy-%:
 	cargo clippy ${_FEATURES_${@:clippy-%=%}} ${ARGS} --all-targets -- -D warnings -A deprecated
 
 test-ui-%:
-	cargo +${MSRV} test --test derive_ui --features derive ${_FEATURES_${@:test-ui-%=%}}
+	cargo +${STABLE} test --test derive_ui --features derive ${_FEATURES_${@:test-ui-%=%}}
 
 doc:
 	cargo doc --workspace --all-features --no-deps --document-private-items


Test patch:
diff --git a/tests/derive_ui.rs b/tests/derive_ui.rs
index 85156a30..6f3e1c14 100644
--- a/tests/derive_ui.rs
+++ b/tests/derive_ui.rs
@@ -6,7 +6,7 @@
 // option. This file may not be copied, modified, or distributed
 
 #[cfg(feature = "derive")]
-#[rustversion::attr(any(not(stable), before(1.74), since(1.75)), ignore)] // MSRV
+#[rustversion::attr(not(stable(1.80)), ignore)] // STABLE
 #[test]
 fn ui() {
     let t = trybuild::TestCases::new();
diff --git a/tests/derive_ui/flatten_enum_in_struct.stderr b/tests/derive_ui/flatten_enum_in_struct.stderr
index 0bff54ff..e0580f5b 100644
--- a/tests/derive_ui/flatten_enum_in_struct.stderr
+++ b/tests/derive_ui/flatten_enum_in_struct.stderr
@@ -5,5 +5,5 @@ error[E0277]: the trait bound `SubCmd: clap::Args` is not satisfied
   |          ^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
   |
   = help: the following other types implement trait `clap::Args`:
-            Opt
             Box<T>
+            Opt
diff --git a/tests/derive_ui/flatten_struct_in_enum.stderr b/tests/derive_ui/flatten_struct_in_enum.stderr
index 8bc814ac..3ed646b8 100644
--- a/tests/derive_ui/flatten_struct_in_enum.stderr
+++ b/tests/derive_ui/flatten_struct_in_enum.stderr
@@ -5,5 +5,5 @@ error[E0277]: the trait bound `SubCmd: Subcommand` is not satisfied
   |         ^^^^^^ the trait `Subcommand` is not implemented for `SubCmd`
   |
   = help: the following other types implement trait `Subcommand`:
-            Opt
             Box<T>
+            Opt
diff --git a/tests/derive_ui/group_name_attribute.stderr b/tests/derive_ui/group_name_attribute.stderr
index 67922f48..171024db 100644
--- a/tests/derive_ui/group_name_attribute.stderr
+++ b/tests/derive_ui/group_name_attribute.stderr
@@ -2,4 +2,9 @@ error[E0599]: no method named `name` found for struct `ArgGroup` in the current
   --> tests/derive_ui/group_name_attribute.rs:11:26
    |
 11 | #[group(required = true, name = "src")]
-   |                          ^^^^ method not found in `ArgGroup`
+   |                          ^^^^
+   |
+help: there is a method `ne` with a similar name
+   |
+11 | #[group(required = true, ne = "src")]
+   |                          ~~