Skip to content

Commit 296031b

Browse files
committed
Add test for new csharp project detection logic
1 parent 82fdd23 commit 296031b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

crates/plugins/csharp/src/plugin.rs

+12
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,18 @@ mod test {
545545
assert_eq!(dir, Path::new("dir1/dir2/dir3"))
546546
}
547547

548+
#[test]
549+
fn finds_project_dir_in_zip_cs() {
550+
init();
551+
552+
let temp = TempDir::new().unwrap();
553+
file_to(&temp, "dir1/dir2/dir3/src/dir4/sample.cs", "");
554+
let bytes = dir_to_zip(&temp);
555+
let mut zip = Archive::zip(std::io::Cursor::new(bytes)).unwrap();
556+
let dir = CSharpPlugin::find_project_dir_in_archive(&mut zip).unwrap();
557+
assert_eq!(dir, Path::new("dir1/dir2/dir3"))
558+
}
559+
548560
#[test]
549561
fn no_project_dir_in_zip() {
550562
init();

0 commit comments

Comments
 (0)