2020-12-27 13:11:08 +01:00
|
|
|
package query
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2021-04-19 13:48:46 +02:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2020-12-27 13:11:08 +01:00
|
|
|
)
|
|
|
|
|
2021-03-03 11:49:32 +01:00
|
|
|
//TODO find duplicates
|
2021-02-06 16:30:30 +01:00
|
|
|
func TestDuplicates(t *testing.T) {
|
2021-03-03 11:49:32 +01:00
|
|
|
t.Run("success", func(t *testing.T) {
|
|
|
|
if files, err := Duplicates(10, 0, ""); err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
} else if files == nil {
|
|
|
|
t.Fatal("files must not be nil")
|
|
|
|
}
|
|
|
|
})
|
|
|
|
t.Run("pathname not empty", func(t *testing.T) {
|
|
|
|
files, err := Duplicates(10, 0, "/holiday/sea.jpg")
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.Empty(t, files)
|
|
|
|
})
|
2020-12-27 13:11:08 +01:00
|
|
|
}
|