@@ -12,24 +12,34 @@ test_that ("release", {
1212 file.remove (file.path (d , " README.Rmd" ))
1313
1414 x <- utils :: capture.output (
15- srr_stats_pre_submit (d ),
15+ rep <- srr_stats_pre_submit (d ),
1616 type = " message"
1717 )
1818 expect_true (length (x ) > 100 ) # > 100 standards are missing
1919
20- errs <- grep (" ^\\ !" , x )
21- expect_length (errs , 4L )
20+ errs_output <- grep (" ^\\ !" , x )
21+ expect_length (errs_output , 4L )
22+ # Report has error text only, no symbols or exclamations:
23+ errs_rep <- grep (" ^\\ !" , rep )
24+ expect_length (errs_rep , 0L )
2225
2326 msg <- " package still has TODO standards and can not be submitted"
2427 expect_length (grep (msg , x ), 1L )
28+ expect_length (grep (msg , rep ), 1L )
2529 msg <- " the following standards (.*) are missing from your code"
2630 expect_length (grep (msg , x ), 1L )
31+ expect_length (grep (msg , rep ), 1L )
2732
2833 msg <- " must comply with at least 50% of all standards"
2934 expect_length (grep (msg , x ), 1L )
35+ expect_length (grep (msg , rep ), 1L )
3036 msg <- " must comply with at least 50% of category-specific standards"
3137 expect_length (grep (msg , x ), 1L )
38+ expect_length (grep (msg , rep ), 1L )
3239
33- missing_stds <- grep (" ^[0-9]+" , x )
34- expect_true (length (missing_stds ) > 100L )
40+ missing_stds_output <- grep (" ^[0-9]+" , x )
41+ missing_stds_rep <- grep (" [A-Z][0-9]+\\ .[0-9]" , rep , value = T )
42+ expect_true (length (missing_stds_output ) > 100L )
43+ expect_true (length (missing_stds_rep ) > 100L )
44+ expect_equal (length (missing_stds_output ), length (missing_stds_rep ))
3545})
0 commit comments