You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
385 B
Go
24 lines
385 B
Go
3 years ago
|
package stario
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func Test_Slice(t *testing.T) {
|
||
|
var data = InputMsg{
|
||
|
msg: "true,false,true,true,false,0,1,hello",
|
||
|
err: nil,
|
||
|
skipSliceSigErr: false,
|
||
|
}
|
||
|
res, err := data.IgnoreSliceParseError(true).SliceBool(",")
|
||
|
if err != nil {
|
||
|
fmt.Println(res)
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
if len(res) == 0 {
|
||
|
t.Fatal(res)
|
||
|
}
|
||
|
fmt.Println(res)
|
||
|
}
|