golifehk/datasources/kmb/query_test.go

37 lines
754 B
Go
Raw Normal View History

2022-09-16 20:33:47 +00:00
package kmb
import (
"fmt"
"testing"
)
func TestQuerySchedule( t *testing.T ) {
2022-09-16 22:42:49 +00:00
qo := Query( "zh-Hant", "68X" )
mesg, err := qo.Message()
if err != nil {
t.Errorf( "Unexpected Error: %s", err )
}
fmt.Println( mesg )
qo = Query( "zh-Hant", "K66 朗屏" )
mesg, err = qo.Message()
if err == nil {
t.Errorf( "Expected Error: %s, got \"\" instead", mesg )
}
2022-09-25 10:48:22 +00:00
qo = Query( "zh-Hant", "大欖" )
mesg, err = qo.Message()
if err != nil {
t.Errorf( "Unexpected Error: %s", err )
}
fmt.Println( mesg )
qo = Query( "zh-Hant", "261B 大欖" )
mesg, err = qo.Message()
if err != nil {
t.Errorf( "Unexpected Error: %s", err )
}
fmt.Println( mesg )
2022-09-16 20:33:47 +00:00
}