2020-01-07 17:36:49 +01:00
|
|
|
package txt
|
2019-07-17 13:26:20 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2019-12-11 14:10:20 +01:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2019-07-17 13:26:20 +02:00
|
|
|
)
|
|
|
|
|
2019-12-17 17:03:56 +01:00
|
|
|
func TestContainsNumber(t *testing.T) {
|
|
|
|
t.Run("True", func(t *testing.T) {
|
|
|
|
assert.Equal(t, true, ContainsNumber("f3abcde"))
|
|
|
|
})
|
|
|
|
t.Run("False", func(t *testing.T) {
|
|
|
|
assert.Equal(t, false, ContainsNumber("abcd"))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2020-04-28 17:03:37 +02: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(""))
|
|
|
|
})
|
|
|
|
}
|