options_test.go 581 B

1234567891011121314151617181920212223242526272829
  1. package micro
  2. import (
  3. "fmt"
  4. "testing"
  5. )
  6. func TestOptions_ShortName(t *testing.T) {
  7. tests := []struct {
  8. name string
  9. o *Options
  10. want string
  11. }{
  12. {"package", &Options{Name: "git.nspix.com/golang/solar"}, "solar"},
  13. {"string", &Options{Name: "solar"}, "solar"},
  14. {"package", &Options{Name: "a.solar"}, "a.solar"},
  15. }
  16. for _, tt := range tests {
  17. t.Run(tt.name, func(t *testing.T) {
  18. if got := tt.o.ShortName(); got != tt.want {
  19. t.Errorf("Options.ShortName() = %v, want %v", got, tt.want)
  20. }
  21. })
  22. }
  23. }
  24. func TestMath(t *testing.T) {
  25. fmt.Println(100 / 105)
  26. }