Skip to content

Commit 2ac4336

Browse files
committed
Remove non ascii file from repo, to fix broken go get
1 parent ee5b78e commit 2ac4336

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [v1.0.19] - 2023-06-06
8+
9+
### Fixed
10+
- `go get` would fail due to the `non–ascii.txt` file in one of the test cases. File is now created ad-hoc during the test and then cleaned up.
11+
712
## [v0.12.19] - 2023-02-24
813

914
### Fixed

src/archiveClient/handler_findFilesByRules_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ var findByRulesTestCases = []struct {
223223
}
224224

225225
func TestFindFilesByRules(t *testing.T) {
226+
def, err := createNonAsciiFile()
227+
if err != nil {
228+
t.Fatal(err)
229+
}
230+
defer def()
231+
226232
ctrl := gomock.NewController(t)
227233
uxBlocks := mocks.NewMockUxBlocks(ctrl)
228234
uxBlocks.EXPECT().PrintInfo(gomock.Any()).AnyTimes()

src/archiveClient/handler_findGitFiles_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package archiveClient
22

33
import (
44
"context"
5+
"os"
56
"testing"
67

78
"github.com/stretchr/testify/require"
@@ -30,6 +31,12 @@ var findGitFilesTestCases = []struct {
3031
}
3132

3233
func TestFindGitFiles(t *testing.T) {
34+
def, err := createNonAsciiFile()
35+
if err != nil {
36+
t.Fatal(err)
37+
}
38+
defer def()
39+
3340
ctx := context.TODO()
3441
for _, test := range findGitFilesTestCases {
3542
t.Run(test.name+"-in-"+test.workingDir, func(t *testing.T) {
@@ -48,3 +55,16 @@ func TestFindGitFiles(t *testing.T) {
4855
})
4956
}
5057
}
58+
59+
// creates a non ascii file and returns a function to clean it up afterward
60+
// needs to be done like this, otherwise `go get` fails on "malformed file path"
61+
func createNonAsciiFile() (func(), error) {
62+
file, err := os.Create("./test/var/www/non–ascii.txt")
63+
if err != nil {
64+
return nil, err
65+
}
66+
return func() {
67+
file.Close()
68+
os.Remove(file.Name())
69+
}, nil
70+
}

src/archiveClient/test/var/www/non–ascii.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)