Added kmb and refactored query.Parse
This commit is contained in:
@@ -2,11 +2,32 @@ package bus
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestQuerySchedule( t *testing.T ) {
|
||||
qo := Query( "zh", "水" )
|
||||
func TestQuery( t *testing.T ) {
|
||||
qo := Query( "zh-Hant", "K73" )
|
||||
mesg, err := qo.Message()
|
||||
if err != nil {
|
||||
t.Errorf( "Unexpected Error: %s", err )
|
||||
}
|
||||
|
||||
fmt.Print( qo.Message() )
|
||||
if !strings.Contains( mesg, "K73\\-O" ) {
|
||||
t.Errorf( "Expected Route Listing, got \"%s\" instead", mesg )
|
||||
}
|
||||
|
||||
qo = Query( "zh-Hant", "K76 池" )
|
||||
mesg, err = qo.Message()
|
||||
if err == nil {
|
||||
t.Errorf( "Expecting error, got \"%s\" instead", mesg )
|
||||
}
|
||||
|
||||
qo = Query( "zh-Hant", "K73 池" )
|
||||
mesg, err = qo.Message()
|
||||
if err != nil {
|
||||
t.Errorf( "Unexpected Error: %s", err )
|
||||
}
|
||||
|
||||
fmt.Println( mesg )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user