Skip to content

Commit

Permalink
fully test checkPaths
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcz committed Sep 26, 2024
1 parent 492e53e commit 4df9fed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/s3backup/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ import (
)

func TestCheckPaths(t *testing.T) {
localPath = "s3://foo/bar.txt"
remotePath = "s3://foo/bar.txt"
assert.Error(t, checkPaths(), "cannot have two remote paths")

localPath = "bar.txt"
remotePath = "bar.txt"
assert.Error(t, checkPaths(), "cannot have two local paths")

localPath = "bar.txt"
remotePath = "s3://foo/bar.txt"
assert.NilError(t, checkPaths())

localPath = "s3://foo/bar.txt"
remotePath = "bar.txt"
assert.NilError(t, checkPaths())
Expand Down

0 comments on commit 4df9fed

Please sign in to comment.