File tree Expand file tree Collapse file tree 4 files changed +31
-0
lines changed
Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
55and 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
Original file line number Diff line number Diff line change @@ -223,6 +223,12 @@ var findByRulesTestCases = []struct {
223223}
224224
225225func 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 ()
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package archiveClient
22
33import (
44 "context"
5+ "os"
56 "testing"
67
78 "github.com/stretchr/testify/require"
@@ -30,6 +31,12 @@ var findGitFilesTestCases = []struct {
3031}
3132
3233func 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+ }
You can’t perform that action at this time.
0 commit comments