diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-06-25 19:52:02 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-09-16 12:32:19 +0200 |
commit | 96920d807ca871c619df8b5ea49c58c126c5df90 (patch) | |
tree | 0746df9129b31ac46fe8e7d5cb9009d7a7c92ceb | |
parent | 27f6085f0cc2f882656d40e2b4665e20a4a80959 (diff) |
Impl Condition::new() if in testing code
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
-rw-r--r-- | src/package/dependency/condition.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/package/dependency/condition.rs b/src/package/dependency/condition.rs index 81892c7..cd8010e 100644 --- a/src/package/dependency/condition.rs +++ b/src/package/dependency/condition.rs @@ -41,6 +41,17 @@ pub struct Condition { pub(super) in_image: Option<OneOrMore<String>>, } +#[cfg(test)] +impl Condition { + pub fn new(has_env: Option<OneOrMore<EnvironmentVariableName>>, + env_eq: Option<HashMap<EnvironmentVariableName, String>>, + in_image: Option<OneOrMore<String>>) + -> Self + { + Condition { has_env, env_eq, in_image } + } +} + /// Manual implementation of PartialOrd for Condition /// /// Because HashMap does not implement PartialOrd |