File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ impl StudentFilePolicy for CSharpStudentFilePolicy {
3737 // false for files in bin or obj directories, true for other files in src.
3838 fn is_student_source_file ( path : & Path ) -> bool {
3939 path. starts_with ( "src" ) && !Self :: is_child_of_binary_dir ( path)
40+ // exclude .csproj files
41+ && !path. extension ( ) . map ( |ext| ext == "csproj" ) . unwrap_or_default ( )
4042 }
4143}
4244
@@ -63,4 +65,14 @@ mod test {
6365 "src/any/file"
6466 ) ) ) ;
6567 }
68+
69+ #[ test]
70+ fn csproj_file_in_src_is_not_student_file ( ) {
71+ assert ! ( !CSharpStudentFilePolicy :: is_student_source_file( Path :: new(
72+ "src/file.csproj"
73+ ) ) ) ;
74+ assert ! ( !CSharpStudentFilePolicy :: is_student_source_file( Path :: new(
75+ "src/any/file.csproj"
76+ ) ) ) ;
77+ }
6678}
You can’t perform that action at this time.
0 commit comments