From 9a5e4141492a0798b4fa1edd834dea5f4017430e Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Tue, 17 Dec 2024 19:29:59 +0100 Subject: [PATCH] fix test --- src/recipe/parser/requirements.rs | 12 ++++++------ .../recipes/race-condition/recipe-python-min.yaml | 2 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/recipe/parser/requirements.rs b/src/recipe/parser/requirements.rs index c2784286..7e76131a 100644 --- a/src/recipe/parser/requirements.rs +++ b/src/recipe/parser/requirements.rs @@ -370,12 +370,12 @@ impl TryConvertNode for RenderedScalarNode { // if we have a matchspec that is only numbers, and ., we complain and ask the user to add a // `.*` or `==` in front of it. - let splitted = string.split_whitespace().collect::>(); - if splitted.len() >= 2 { - if splitted[1].chars().all(|c| c.is_numeric() || c == '.') { - let name = splitted[0]; - let version = splitted[1]; - let rest = splitted[2..].join(" "); + let split_string = string.split_whitespace().collect::>(); + if split_string.len() >= 2 { + if split_string[1].chars().all(|c| c.is_numeric() || c == '.') { + let name = split_string[0]; + let version = split_string[1]; + let rest = split_string[2..].join(" "); let rest = if rest.is_empty() { "".to_string() } else { diff --git a/test-data/recipes/race-condition/recipe-python-min.yaml b/test-data/recipes/race-condition/recipe-python-min.yaml index d959a763..e647b8f7 100644 --- a/test-data/recipes/race-condition/recipe-python-min.yaml +++ b/test-data/recipes/race-condition/recipe-python-min.yaml @@ -4,12 +4,10 @@ package: requirements: host: - - python ${{ python_min }} - python >=${{ python_min }} - python ${{ python_min }}.* - python ${{ python_min ~ ".*,<4.0a0" }} run: - - python ${{ python_min }} - python >=${{ python_min }} - python ${{ python_min }}.* - python ${{ python_min ~ ".*,<4.0a0" }}