Skip to content

Commit

Permalink
add test for line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Nov 28, 2024
1 parent f5a32fc commit ec67d22
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,30 @@ async fn test_reproducible_shasum(
insta::assert_snapshot!(format!("sha256-{}-executable", platform), &sha256_digest);
}

#[rstest]
#[case(Platform::Linux64)]
#[case(Platform::Win64)]
#[tokio::test]
async fn test_line_endings(
#[case] platform: Platform,
#[with(PathBuf::from("examples/simple-python/pixi.toml"), "default".to_string(), platform, None, None, false, "env".to_string(), true)]
options: Options,
) {
let pack_result = pixi_pack::pack(options.pack_options.clone()).await;
assert!(pack_result.is_ok(), "{:?}", pack_result);

let out_file = options.pack_options.output_file.clone();
let output = fs::read_to_string(&out_file).unwrap();

if platform.is_windows() {
let num_crlf = output.matches("\r\n").count();
let num_lf = output.matches("\n").count();
assert_eq!(num_crlf, num_lf);
} else {
assert!(!output.contains("\r\n"));
}
}

#[rstest]
#[tokio::test]
async fn test_non_authenticated(
Expand Down

0 comments on commit ec67d22

Please sign in to comment.