Skip to content

Commit

Permalink
Add test for new csharp project detection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Heliozoa committed Dec 17, 2024
1 parent 82fdd23 commit 296031b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/plugins/csharp/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,18 @@ mod test {
assert_eq!(dir, Path::new("dir1/dir2/dir3"))
}

#[test]
fn finds_project_dir_in_zip_cs() {
init();

let temp = TempDir::new().unwrap();
file_to(&temp, "dir1/dir2/dir3/src/dir4/sample.cs", "");
let bytes = dir_to_zip(&temp);
let mut zip = Archive::zip(std::io::Cursor::new(bytes)).unwrap();
let dir = CSharpPlugin::find_project_dir_in_archive(&mut zip).unwrap();
assert_eq!(dir, Path::new("dir1/dir2/dir3"))
}

#[test]
fn no_project_dir_in_zip() {
init();
Expand Down

0 comments on commit 296031b

Please sign in to comment.