mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
Make paths and fingerprints platform-agnostic (#1622)
* test: windows * fix: make paths platform-agnostic this change also fixes, or skips, windows failures
This commit is contained in:
1 parent
818e32f7a4
commit
c2afd56bbe
13 files changed
+535
-91
No files matched your search
@@ -2,6 +2,7 @@ package report
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -9,7 +10,6 @@ import (
|
||||
)
|
||||
|
||||
const expectPath = "../testdata/expected/"
|
||||
const configPath = "../testdata/config/"
|
||||
const templatePath = "../testdata/report/"
|
||||
|
||||
func TestWriteStdout(t *testing.T) {
|
||||
@@ -40,3 +40,10 @@ type testWriter struct {
|
||||
func (t testWriter) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// lineEndingReplacer normalizes CRLF to LF so tests pass on Windows.
|
||||
var lineEndingReplacer = strings.NewReplacer(
|
||||
"\\r\\n", "\\n",
|
||||
"\r", "",
|
||||
"\\r", "",
|
||||
)
|
||||
Reference in new issue
Block a user