@@ -46,30 +46,30 @@ func TestSanitize(t *testing.T) {
46
46
47
47
func TestMoveFile (t * testing.T ) {
48
48
// Make temporary cache directory
49
- if err := os .Mkdir ("/tmp/test-cache " , 0755 ); err != nil && ! os .IsExist (err ) {
49
+ if err := os .Mkdir ("/tmp/test-move " , 0755 ); err != nil && ! os .IsExist (err ) {
50
50
t .Error (err )
51
51
}
52
52
53
53
inputString := "Test File"
54
54
55
55
//nolint:golint,gosec
56
- assert .Nil (t , os .WriteFile ("/tmp/test-cache /source.txt" , []byte (inputString ), 0644 ))
56
+ assert .Nil (t , os .WriteFile ("/tmp/test-move /source.txt" , []byte (inputString ), 0644 ))
57
57
58
- assert .Nil (t , MoveFile ("/tmp/test-cache /source.txt" , "/tmp/test-cache /dest.txt" ))
58
+ assert .Nil (t , MoveFile ("/tmp/test-move /source.txt" , "/tmp/test-move /dest.txt" ))
59
59
60
- if _ , err := os .Stat ("/tmp/test-cache /dest.txt" ); os .IsNotExist (err ) {
60
+ if _ , err := os .Stat ("/tmp/test-move /dest.txt" ); os .IsNotExist (err ) {
61
61
t .Errorf ("file text-cache/dest.txt doesn't exist but should" )
62
62
}
63
63
64
- if _ , err := os .Stat ("/tmp/test-cache /source.txt" ); err == nil {
64
+ if _ , err := os .Stat ("/tmp/test-move /source.txt" ); err == nil {
65
65
t .Errorf ("file text-cache/source.txt exists but shouldn't" )
66
66
}
67
67
68
- contents , err := os .ReadFile ("/tmp/test-cache /dest.txt" )
68
+ contents , err := os .ReadFile ("/tmp/test-move /dest.txt" )
69
69
assert .Nil (t , err )
70
70
assert .Equal (t , inputString , string (contents ))
71
71
72
- assert .Nil (t , os .Remove ("/tmp/test-cache /dest.txt" ))
72
+ assert .Nil (t , os .Remove ("/tmp/test-move /dest.txt" ))
73
73
}
74
74
75
75
func TestPrintTable (t * testing.T ) {
0 commit comments