@@ -8,7 +8,7 @@ use std::time::Duration;
88use tmc_langs_framework:: {
99 anyhow,
1010 domain:: { ExerciseDesc , RunResult , RunStatus , TestDesc , TestResult } ,
11- nom:: IResult ,
11+ nom:: { self , error :: VerboseError , IResult } ,
1212 zip:: ZipArchive ,
1313 LanguagePlugin , StudentFilePolicy , TmcError ,
1414} ;
@@ -102,8 +102,9 @@ impl LanguagePlugin for NoTestsPlugin {
102102 vec ! [ PathBuf :: from( "test" ) ]
103103 }
104104
105- fn points_parser ( _: & str ) -> IResult < & str , & str > {
106- Ok ( ( "" , "" ) )
105+ fn points_parser ( i : & str ) -> IResult < & str , & str , VerboseError < & str > > {
106+ // does not match any characters
107+ nom:: combinator:: value ( "" , nom:: character:: complete:: one_of ( "" ) ) ( i)
107108 }
108109}
109110
@@ -228,4 +229,26 @@ no-tests: false
228229 ) ;
229230 assert ! ( !NoTestsPlugin :: is_exercise_type_correct( temp_dir. path( ) ) ) ;
230231 }
232+
233+ #[ test]
234+ fn parses_empty ( ) {
235+ init ( ) ;
236+
237+ let temp = tempfile:: tempdir ( ) . unwrap ( ) ;
238+ file_to ( & temp, "test/.keep" , r#""# ) ;
239+
240+ let points = NoTestsPlugin :: get_available_points ( temp. path ( ) ) . unwrap ( ) ;
241+ assert ! ( points. is_empty( ) ) ;
242+
243+ let temp = tempfile:: tempdir ( ) . unwrap ( ) ;
244+ file_to (
245+ & temp,
246+ "test/.keep" ,
247+ r#"
248+ "# ,
249+ ) ;
250+
251+ let points = NoTestsPlugin :: get_available_points ( temp. path ( ) ) . unwrap ( ) ;
252+ assert ! ( points. is_empty( ) ) ;
253+ }
231254}
0 commit comments