test(tvix/glue): improve comments and test cases a bit
This makes it easier to understand what the specific test is testing. Change-Id: I34b2798841c6b9367849668451af2165dc78f997 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12626 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com> Tested-by: BuildkiteCI Reviewed-by: Jörg Thalheim <joerg@thalheim.io>
This commit is contained in:
parent
457decb790
commit
baebe29bab
1 changed files with 12 additions and 14 deletions
|
|
@ -537,14 +537,13 @@ mod tests {
|
||||||
assert!(eval_result.errors.is_empty(), "errors should be empty");
|
assert!(eval_result.errors.is_empty(), "errors should be empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Space is an illegal character.
|
/// Space is an illegal character, but if we specify a name without spaces, it's ok.
|
||||||
#[rstest]
|
#[rstest]
|
||||||
#[case(
|
#[case::rename_success(
|
||||||
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = true; })"#,
|
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = true; })"#,
|
||||||
true
|
true
|
||||||
)]
|
)]
|
||||||
// Space is still an illegal character.
|
#[case::rename_with_spaces_fail(
|
||||||
#[case(
|
|
||||||
r#"(builtins.path { name = "invalid name"; path = @fixtures + "/te st"; recursive = true; })"#,
|
r#"(builtins.path { name = "invalid name"; path = @fixtures + "/te st"; recursive = true; })"#,
|
||||||
false
|
false
|
||||||
)]
|
)]
|
||||||
|
|
@ -583,14 +582,13 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Space is an illegal character.
|
/// Space is an illegal character, but if we specify a name without spaces, it's ok.
|
||||||
#[rstest]
|
#[rstest]
|
||||||
#[case(
|
#[case::rename_success(
|
||||||
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = false; })"#,
|
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = false; })"#,
|
||||||
true
|
true
|
||||||
)]
|
)]
|
||||||
// Space is still an illegal character.
|
#[case::rename_with_spaces_fail(
|
||||||
#[case(
|
|
||||||
r#"(builtins.path { name = "invalid name"; path = @fixtures + "/te st"; recursive = false; })"#,
|
r#"(builtins.path { name = "invalid name"; path = @fixtures + "/te st"; recursive = false; })"#,
|
||||||
false
|
false
|
||||||
)]
|
)]
|
||||||
|
|
@ -631,20 +629,20 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rstest]
|
#[rstest]
|
||||||
#[case(
|
#[case::flat_success(
|
||||||
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = false; sha256 = "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="; })"#,
|
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = false; sha256 = "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="; })"#,
|
||||||
true
|
true
|
||||||
)]
|
)]
|
||||||
#[case(
|
#[case::flat_fail(
|
||||||
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = true; sha256 = "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="; })"#,
|
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = false; sha256 = "sha256-d6xi4mKdjkX2JFicDIv5niSzpyI0m/Hnm8GGAIU04kY="; })"#,
|
||||||
false
|
false
|
||||||
)]
|
)]
|
||||||
#[case(
|
#[case::recursive_success(
|
||||||
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = true; sha256 = "sha256-d6xi4mKdjkX2JFicDIv5niSzpyI0m/Hnm8GGAIU04kY="; })"#,
|
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = true; sha256 = "sha256-d6xi4mKdjkX2JFicDIv5niSzpyI0m/Hnm8GGAIU04kY="; })"#,
|
||||||
true
|
true
|
||||||
)]
|
)]
|
||||||
#[case(
|
#[case::recursive_fail(
|
||||||
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = false; sha256 = "sha256-d6xi4mKdjkX2JFicDIv5niSzpyI0m/Hnm8GGAIU04kY="; })"#,
|
r#"(builtins.path { name = "valid-name"; path = @fixtures + "/te st"; recursive = true; sha256 = "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="; })"#,
|
||||||
false
|
false
|
||||||
)]
|
)]
|
||||||
fn builtins_path_fod_locking(#[case] code: &str, #[case] exp_success: bool) {
|
fn builtins_path_fod_locking(#[case] code: &str, #[case] exp_success: bool) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue