Files
forever-files/fileUtilities/zip_test.go
2023-07-18 18:21:12 -06:00

37 lines
698 B
Go

package fileUtilities
import "testing"
func Test_replaceBackslashes(t *testing.T) {
type args struct {
input string
}
tests := []struct {
name string
args args
want string
}{
{
name: "replace backslashes",
args: args{
input: "C:\\Users\\james\\Documents\\test",
},
want: "C:/Users/james/Documents/test",
},
{
name: "no backslashes",
args: args{
input: "C:/Users/james/Documents/test",
},
want: "C:/Users/james/Documents/test",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := replaceBackslashes(tt.args.input); got != tt.want {
t.Errorf("replaceBackslashes() = %v, want %v", got, tt.want)
}
})
}
}