17 lines
626 B
Go
17 lines
626 B
Go
package cp
|
|
|
|
import "testing"
|
|
|
|
func TestIntimacyLeaderboardScorePreservesPrimaryIntimacyAndBatchOrder(t *testing.T) {
|
|
total := 1000
|
|
if intimacyLeaderboardScore(101, total-1, total) <= intimacyLeaderboardScore(100, 0, total) {
|
|
t.Fatal("higher intimacy value must always outrank lower intimacy value")
|
|
}
|
|
if intimacyLeaderboardScore(100, 0, total) <= intimacyLeaderboardScore(100, 1, total) {
|
|
t.Fatal("same intimacy value must keep repository order")
|
|
}
|
|
if intimacyLeaderboardScore(100, 1, total) <= intimacyLeaderboardScore(100, 2, total) {
|
|
t.Fatal("same intimacy value must keep stable order across later rows")
|
|
}
|
|
}
|