This [line](https://github.com/hadley/testthat/blob/master/R/test-files.R#L76): ``` test_names <- gsub("\\.[rR]", "", test_names) ``` Should be (I think): ``` test_names <- sub("\\.[rR]$", "", test_names) ``` I'll submit a pull request in a few minutes to fix.