photoprism/pkg/txt/strings_test.go

23 lines
446 B
Go
Raw Normal View History

package txt
2019-07-17 11:26:20 +00:00
import (
"testing"
"github.com/stretchr/testify/assert"
2019-07-17 11:26:20 +00:00
)
2020-04-28 15:03:37 +00:00
func TestBool(t *testing.T) {
t.Run("not empty", func(t *testing.T) {
assert.Equal(t, true, Bool("Browse your life in pictures"))
})
t.Run("no", func(t *testing.T) {
assert.Equal(t, false, Bool("no"))
})
t.Run("false", func(t *testing.T) {
assert.Equal(t, false, Bool("false"))
})
t.Run("empty", func(t *testing.T) {
assert.Equal(t, false, Bool(""))
})
}