summaryrefslogtreecommitdiffstats
path: root/vendor/gix-credentials/tests/program
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:41:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:41:41 +0000
commit10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87 (patch)
treebdffd5d80c26cf4a7a518281a204be1ace85b4c1 /vendor/gix-credentials/tests/program
parentReleasing progress-linux version 1.70.0+dfsg1-9~progress7.99u1. (diff)
downloadrustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.tar.xz
rustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.zip
Merging upstream version 1.70.0+dfsg2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-credentials/tests/program')
-rw-r--r--vendor/gix-credentials/tests/program/from_custom_definition.rs42
-rw-r--r--vendor/gix-credentials/tests/program/mod.rs1
2 files changed, 43 insertions, 0 deletions
diff --git a/vendor/gix-credentials/tests/program/from_custom_definition.rs b/vendor/gix-credentials/tests/program/from_custom_definition.rs
new file mode 100644
index 000000000..1b9d8a056
--- /dev/null
+++ b/vendor/gix-credentials/tests/program/from_custom_definition.rs
@@ -0,0 +1,42 @@
+use gix_credentials::{program::Kind, Program};
+
+#[test]
+fn script() {
+ assert!(
+ matches!(Program::from_custom_definition("!exe").kind, Kind::ExternalShellScript(script) if script == "exe")
+ );
+}
+
+#[test]
+fn name_with_args() {
+ let input = "name --arg --bar=\"a b\"";
+ let expected = "git credential-name --arg --bar=\"a b\"";
+ assert!(
+ matches!(Program::from_custom_definition(input).kind, Kind::ExternalName{name_and_args} if name_and_args == expected)
+ );
+}
+
+#[test]
+fn name() {
+ let input = "name";
+ let expected = "git credential-name";
+ assert!(
+ matches!(Program::from_custom_definition(input).kind, Kind::ExternalName{name_and_args} if name_and_args == expected)
+ );
+}
+
+#[test]
+fn path_with_args() {
+ let input = "/abs/name --arg --bar=\"a b\"";
+ assert!(
+ matches!(Program::from_custom_definition(input).kind, Kind::ExternalPath{path_and_args} if path_and_args == input)
+ );
+}
+
+#[test]
+fn path() {
+ let input = "/abs/name";
+ assert!(
+ matches!(Program::from_custom_definition(input).kind, Kind::ExternalPath{path_and_args} if path_and_args == input)
+ );
+}
diff --git a/vendor/gix-credentials/tests/program/mod.rs b/vendor/gix-credentials/tests/program/mod.rs
new file mode 100644
index 000000000..3672dd18e
--- /dev/null
+++ b/vendor/gix-credentials/tests/program/mod.rs
@@ -0,0 +1 @@
+mod from_custom_definition;