-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Richard Gomez
committed
Feb 6, 2024
1 parent
901c851
commit 3fe2eff
Showing
2 changed files
with
35 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -667,12 +667,17 @@ Co-authored-by: Sergey Beryozkin <[email protected]> | |
|
||
func TestBinaryPathParse(t *testing.T) { | ||
cases := map[string]string{ | ||
"Binary files /dev/null and b/plugin.sig differ\n": "plugin.sig", | ||
"Binary files /dev/null and b/ Lunch and Learn - HCDiag.pdf differ\n": " Lunch and Learn - HCDiag.pdf", | ||
"Binary files a/trufflehog_3.42.0_linux_arm64.tar.gz and /dev/null differ\n": "", | ||
"Binary files /dev/null and b/plugin.sig differ\n": "plugin.sig", | ||
"Binary files /dev/null and b/ Lunch and Learn - HCDiag.pdf differ\n": " Lunch and Learn - HCDiag.pdf", | ||
"Binary files /dev/null and \"b/assets/retailers/ON-ikony-Platforma-ecom \\342\\200\\224 kopia.png\" differ": "assets/retailers/ON-ikony-Platforma-ecom \\342\\200\\224 kopia.png", | ||
} | ||
|
||
for name, expected := range cases { | ||
filename := pathFromBinaryLine([]byte(name)) | ||
filename, err := pathFromBinaryLine([]byte(name)) | ||
if err != nil { | ||
t.Errorf("Got unexpected error: %s", err) | ||
} | ||
if filename != expected { | ||
t.Errorf("Expected: %s, Got: %s", expected, filename) | ||
} | ||
|