Initial import
This commit is contained in:
27
string_test.go
Normal file
27
string_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package commons
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestStringNormalize(t *testing.T) {
|
||||
v := " some text here "
|
||||
|
||||
vv := StringNormalize(v)
|
||||
|
||||
if vv != "some text here" {
|
||||
t.Fatal("Text should have been normalized")
|
||||
}
|
||||
}
|
||||
|
||||
func TestStringIsBlank(t *testing.T) {
|
||||
if !StringIsBlank("") {
|
||||
t.Fatal("Failed to check string is blank")
|
||||
}
|
||||
}
|
||||
|
||||
func TestStringIsNotBlank(t *testing.T) {
|
||||
if !StringIsNotBlank("fasdfdas") {
|
||||
t.Fatal("Failed to check string is not blank")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user