template_test.go 435 B

1234567891011121314151617181920
  1. package util
  2. import (
  3. "testing"
  4. )
  5. // TestTemplate testing case about Template method
  6. func TestTemplate(t *testing.T) {
  7. result := Template("{name}={age};{with}={another};any={any};boolean={boolean}", map[string]interface{}{
  8. "name": "Helan",
  9. "age": "33",
  10. "with": "Pep",
  11. "another": "C",
  12. "any": 33,
  13. "boolean": false,
  14. })
  15. if result != "Helan=33;Pep=C;any=33;boolean=false" {
  16. t.Error("NOT PSS testing")
  17. }
  18. }