1234567891011121314151617181920212223242526272829 |
- package micro
- import (
- "fmt"
- "testing"
- )
- func TestOptions_ShortName(t *testing.T) {
- tests := []struct {
- name string
- o *Options
- want string
- }{
- {"package", &Options{Name: "git.nspix.com/golang/solar"}, "solar"},
- {"string", &Options{Name: "solar"}, "solar"},
- {"package", &Options{Name: "a.solar"}, "a.solar"},
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if got := tt.o.ShortName(); got != tt.want {
- t.Errorf("Options.ShortName() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestMath(t *testing.T) {
- fmt.Println(100 / 105)
- }
|