golifehk/datasources/kmb/query_test.go

37 lines
754 B
Go

package kmb
import (
"fmt"
"testing"
)
func TestQuerySchedule( t *testing.T ) {
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 )
}
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 )
}