14 lines
444 B
Go
14 lines
444 B
Go
package api
|
|||
|
|
|
||
|
|
import "testing"
|
||
|
|
|
||
|
|
func TestRequestMatchScorePrefersTheSpecificTitle(t *testing.T) {
|
||
|
|
if requestMatchScore("the office", "The Office") >=
|
||
|
|
requestMatchScore("the office", "The Office Christmas Special") {
|
||
|
|
t.Fatal("exact title should rank ahead of a prefix match")
|
||
|
|
}
|
||
|
|
if requestMatchScore("arrival", "Arrival") >= requestMatchScore("arrival", "The Arrival") {
|
||
|
|
t.Fatal("exact title should rank ahead of a contained match")
|
||
|
|
}
|
||
|
|
}
|