z_test.go 383 B

1234567891011121314151617181920212223
  1. package value
  2. import (
  3. "log"
  4. "testing"
  5. )
  6. func TestValue(t *testing.T) {
  7. val := ValueOf(`{ "one": "111" }`)
  8. s := map[string]string{}
  9. t.Log(val.Setup(&s), s)
  10. val = ValueOf(100.55)
  11. log.Println(val.Int())
  12. val = ValueOf([]string{"one", "two", "three"})
  13. var sls []string
  14. t.Log(val.Setup(&sls), sls)
  15. var ils []int
  16. val = ValueOf("10, 11, 12")
  17. t.Log(val.Setup(&ils), ils)
  18. }