Skip to content

Commit

Permalink
placate clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavderdrache committed Feb 18, 2025
1 parent 046cdb0 commit bb1763a
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/cli/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,31 +497,6 @@ fn validate_segment(s: &str) -> Result<(), FhError> {
Ok(())
}

#[cfg(test)]
mod tests {
#[test]
fn flakehub_url_macro() {
let root = "https://flakehub.com";

for (provided, expected) in vec![
(
flakehub_url!(root, "flake", "DeterminateSystems", "fh"),
"https://flakehub.com/flake/DeterminateSystems/fh",
),
(
flakehub_url!(root, "flake", "NixOS", "nixpkgs", "*"),
"https://flakehub.com/flake/NixOS/nixpkgs/*",
),
(
flakehub_url!(root, "flake", "nix-community", "home-manager", "releases"),
"https://flakehub.com/flake/nix-community/home-manager/releases",
),
] {
assert_eq!(provided.as_ref(), expected);
}
}
}

/// Copy a Nix closure from a given host into the store.
pub async fn copy_closure(
cache_host: impl Into<String>,
Expand Down Expand Up @@ -651,3 +626,28 @@ pub async fn copy_closure_with_gc_root(

Ok(use_out_link)
}

#[cfg(test)]
mod tests {
#[test]
fn flakehub_url_macro() {
let root = "https://flakehub.com";

for (provided, expected) in vec![
(
flakehub_url!(root, "flake", "DeterminateSystems", "fh"),
"https://flakehub.com/flake/DeterminateSystems/fh",
),
(
flakehub_url!(root, "flake", "NixOS", "nixpkgs", "*"),
"https://flakehub.com/flake/NixOS/nixpkgs/*",
),
(
flakehub_url!(root, "flake", "nix-community", "home-manager", "releases"),
"https://flakehub.com/flake/nix-community/home-manager/releases",
),
] {
assert_eq!(provided.as_ref(), expected);
}
}
}

0 comments on commit bb1763a

Please sign in to comment.