Skip to content

Commit

Permalink
test: use snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben-arts committed Dec 20, 2024
1 parent e4fe26c commit d3404a7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
source: crates/pixi_manifest/src/system_requirements.rs
expression: serialized
snapshot_kind: text
---
macos = "10.15"
linux = "5.11"
cuda = "12.2"
libc = "2.12"
archspec = "x86_64"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: crates/pixi_manifest/src/system_requirements.rs
expression: serialized
snapshot_kind: text
---
macos = "10.15"
linux = "5.11"
cuda = "12.2"
archspec = "x86_64"

[libc]
family = "glibc"
version = "2.12"
28 changes: 2 additions & 26 deletions crates/pixi_manifest/src/system_requirements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,18 +522,7 @@ mod tests {
};

let serialized = to_string_pretty(&system_requirements).unwrap();

let expected = r#"
macos = "10.15"
linux = "5.11"
cuda = "12.2"
libc = "2.12"
archspec = "x86_64"
"#;
assert_eq!(
serialized.replace("\n", "").replace(" ", ""),
expected.replace("\n", "").replace(" ", "")
);
assert_snapshot!(serialized);
}

#[test]
Expand All @@ -550,19 +539,6 @@ mod tests {
};

let serialized = to_string_pretty(&system_requirements).unwrap();
let expected = r#"
macos = "10.15"
linux = "5.11"
cuda = "12.2"
archspec = "x86_64"
[libc]
family = "glibc"
version = "2.12"
"#;
assert_eq!(
serialized.replace("\n", "").replace(" ", ""),
expected.replace("\n", "").replace(" ", "")
);
assert_snapshot!(serialized);
}
}

0 comments on commit d3404a7

Please sign in to comment.