Skip to content

Commit

Permalink
refactor, Use the default language file extension and test file suffi…
Browse files Browse the repository at this point in the history
…x functions, for consistency

Part of #300
  • Loading branch information
ruiAzevedo19 committed Aug 2, 2024
1 parent 3156606 commit af333f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion language/golang/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (l *Language) ImportPath(projectRootPath string, filePath string) (importPa

// TestFilePath returns the file path of a test file given the corresponding file path of the test's source file.
func (l *Language) TestFilePath(projectRootPath string, filePath string) (testFilePath string) {
return strings.TrimSuffix(filePath, ".go") + "_test.go"
return strings.TrimSuffix(filePath, l.DefaultFileExtension()) + l.DefaultTestFileSuffix()
}

// TestFramework returns the human-readable name of the test framework that should be used.
Expand Down
2 changes: 1 addition & 1 deletion language/java/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (l *Language) TestFilePath(projectRootPath string, filePath string) (testFi
filePath = filePath[:l] + t + filePath[l+len(t):]
}

return strings.TrimSuffix(filePath, ".java") + "Test.java"
return strings.TrimSuffix(filePath, l.DefaultFileExtension()) + l.DefaultTestFileSuffix()
}

// TestFramework returns the human-readable name of the test framework that should be used.
Expand Down

0 comments on commit af333f1

Please sign in to comment.