You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
587 B
30 lines
587 B
package console_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitoa.ru/go-4devs/console"
|
|
)
|
|
|
|
func TestFind(t *testing.T) {
|
|
cases := map[string]string{
|
|
"fdevs:console:test": "fdevs:console:test",
|
|
"fd:c:t": "fdevs:console:test",
|
|
"fd::t": "fdevs:console:test",
|
|
"f:c:t": "fdevs:console:test",
|
|
"f:c:a": "fdevs:console:arg",
|
|
}
|
|
|
|
for name, ex := range cases {
|
|
res, err := console.Find(name)
|
|
if err != nil {
|
|
t.Errorf("expect <nil> err, got:%s", err)
|
|
|
|
continue
|
|
}
|
|
|
|
if res.Name != ex {
|
|
t.Errorf("expect: %s, got: %s", ex, res)
|
|
}
|
|
}
|
|
}
|
|
|