diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
commit | 4f9fe856a25ab29345b90e7725509e9ee38a37be (patch) | |
tree | e4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /vendor/xflags-macros | |
parent | Adding upstream version 1.68.2+dfsg1. (diff) | |
download | rustc-4f9fe856a25ab29345b90e7725509e9ee38a37be.tar.xz rustc-4f9fe856a25ab29345b90e7725509e9ee38a37be.zip |
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/xflags-macros')
-rw-r--r-- | vendor/xflags-macros/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/xflags-macros/Cargo.toml | 2 | ||||
-rw-r--r-- | vendor/xflags-macros/tests/it/main.rs | 70 |
3 files changed, 72 insertions, 2 deletions
diff --git a/vendor/xflags-macros/.cargo-checksum.json b/vendor/xflags-macros/.cargo-checksum.json index fcc17d504..9f20539ff 100644 --- a/vendor/xflags-macros/.cargo-checksum.json +++ b/vendor/xflags-macros/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"dff52eef5d3a126eefb38eb66ecb194dd9ccd22a6e010df2b672d83264ac65a5","src/ast.rs":"1f3be0fa1c340dbd98f56fd1c10a43b081d4b9179b1666a3dd3f32d8082e452c","src/emit.rs":"03e692330adc927c1d7ea36faebec0df997dd2e6bfb4816661988078b59fdb0b","src/lib.rs":"ce57137b3db248a73b201a5add6b1ac5c80e431e2bc2947962d4b0b6f397a449","src/parse.rs":"15e860ce666b17228ae537b322c096a64696c83b620468a14112bab30c0432a8","src/update.rs":"133dbc864182808ea7679b815863117b51ccc59a0e43796321f9d5a2edcb3ed6","tests/data/help.rs":"a952a2f641fa6db5c7bd25d8480c1dff4f1146db21a0629e0506e4bc87c46d0c","tests/data/repeated_pos.rs":"60b7d6378583765ddda1be127d3f40aa34cf802c64008e9d3a456f5e20100290","tests/data/smoke.rs":"c5d626382c22f147deb0be9396bf4f8256d64618451f8c9b85002d3525c7fff6","tests/data/subcommands.rs":"c2020f895380c95ca6c97f124615ed64f838a6ee3d1bcce8842029c6cef55188","tests/it/help.rs":"d12aba6869f7d40984c9294591fb97fea7d8caf062969e5ae640ba21957a26c3","tests/it/main.rs":"08311bc06020d980867bd696040c6ddd4893700c7a181d4b9d256ef100945a46","tests/it/repeated_pos.rs":"f9acef062eda5ad43722cade6ebde4c0077174a0fae4e2c3c9555ad6dd490599","tests/it/smoke.rs":"3324c20e79258fca2dfe30a7312b5e192d09c104a30142b1362dd89e746d1306","tests/it/subcommands.rs":"900726a1309d753aa3b666c9b3051ec0b26cb1bf59c1d072704d8e497cfa18c4"},"package":"2afbd7f2039bb6cad2dd45f0c5dff49c0d4e26118398768b7a605524d4251809"}
\ No newline at end of file +{"files":{"Cargo.toml":"922faf706912dc58a85a5b8b6a22a7e2dbe17a8682776d25aa8f88c06a3d3bc2","src/ast.rs":"1f3be0fa1c340dbd98f56fd1c10a43b081d4b9179b1666a3dd3f32d8082e452c","src/emit.rs":"03e692330adc927c1d7ea36faebec0df997dd2e6bfb4816661988078b59fdb0b","src/lib.rs":"ce57137b3db248a73b201a5add6b1ac5c80e431e2bc2947962d4b0b6f397a449","src/parse.rs":"15e860ce666b17228ae537b322c096a64696c83b620468a14112bab30c0432a8","src/update.rs":"133dbc864182808ea7679b815863117b51ccc59a0e43796321f9d5a2edcb3ed6","tests/data/help.rs":"a952a2f641fa6db5c7bd25d8480c1dff4f1146db21a0629e0506e4bc87c46d0c","tests/data/repeated_pos.rs":"60b7d6378583765ddda1be127d3f40aa34cf802c64008e9d3a456f5e20100290","tests/data/smoke.rs":"c5d626382c22f147deb0be9396bf4f8256d64618451f8c9b85002d3525c7fff6","tests/data/subcommands.rs":"c2020f895380c95ca6c97f124615ed64f838a6ee3d1bcce8842029c6cef55188","tests/it/help.rs":"d12aba6869f7d40984c9294591fb97fea7d8caf062969e5ae640ba21957a26c3","tests/it/main.rs":"bbae0bff66ccd22f5fb1bcff08d7acadc3c93644bdb90b6f9d9b6ff76dbb9d1a","tests/it/repeated_pos.rs":"f9acef062eda5ad43722cade6ebde4c0077174a0fae4e2c3c9555ad6dd490599","tests/it/smoke.rs":"3324c20e79258fca2dfe30a7312b5e192d09c104a30142b1362dd89e746d1306","tests/it/subcommands.rs":"900726a1309d753aa3b666c9b3051ec0b26cb1bf59c1d072704d8e497cfa18c4"},"package":"f58e7b3ca8977093aae6b87b6a7730216fc4c53a6530bab5c43a783cd810c1a8"}
\ No newline at end of file diff --git a/vendor/xflags-macros/Cargo.toml b/vendor/xflags-macros/Cargo.toml index 70b748f0a..45ce51de8 100644 --- a/vendor/xflags-macros/Cargo.toml +++ b/vendor/xflags-macros/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "xflags-macros" -version = "0.3.0" +version = "0.3.1" authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"] description = "Private implementation details of xflags." license = "MIT OR Apache-2.0" diff --git a/vendor/xflags-macros/tests/it/main.rs b/vendor/xflags-macros/tests/it/main.rs index 7d77bda36..bee65b015 100644 --- a/vendor/xflags-macros/tests/it/main.rs +++ b/vendor/xflags-macros/tests/it/main.rs @@ -230,3 +230,73 @@ fn subcommand_flag_inheritance() { expect!["unexpected flag: `--dir`"], ); } + +#[test] +fn edge_cases() { + check( + subcommands::RustAnalyzer::from_vec, + "server --dir --log", + expect![[r#" + RustAnalyzer { + verbose: 0, + subcommand: Server( + Server { + dir: Some( + "--log", + ), + subcommand: Launch( + Launch { + log: false, + }, + ), + }, + ), + } + "#]], + ); + check( + subcommands::RustAnalyzer::from_vec, + "server --dir -- --log", + expect![[r#" + RustAnalyzer { + verbose: 0, + subcommand: Server( + Server { + dir: Some( + "--", + ), + subcommand: Launch( + Launch { + log: true, + }, + ), + }, + ), + } + "#]], + ); + check( + subcommands::RustAnalyzer::from_vec, + "-- -v server", + expect![[r#"unexpected argument: "-v""#]], + ); + check(repeated_pos::RepeatedPos::from_vec, "pos 1 prog -j", expect!["unexpected flag: `-j`"]); + check( + repeated_pos::RepeatedPos::from_vec, + "pos 1 -- prog -j", + expect![[r#" + RepeatedPos { + a: "pos", + b: Some( + 1, + ), + c: Some( + "prog", + ), + rest: [ + "-j", + ], + } + "#]], + ); +} |