summaryrefslogtreecommitdiff
path: root/factors/factors_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'factors/factors_test.go')
-rw-r--r--factors/factors_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/factors/factors_test.go b/factors/factors_test.go
index ceaf4d1..f14dd31 100644
--- a/factors/factors_test.go
+++ b/factors/factors_test.go
@@ -105,6 +105,23 @@ func TestFactorScore(t *testing.T) {
}
}
+var basicRankCases = map[uint]string{
+ 2: "D-", 3: "E-", 4: "C~", 5: "F+", 6: "B~",
+ 7: "F-", 8: "C-", 9: "E~", 10: "D+", 11: "F~", 12: "A-",
+ 14: "D~", 15: "E+", 18: "B-", 20: "C+", 24: "A~", 30: "B+", 60: "A+",
+}
+
+func TestBasicRank (t *testing.T) {
+ for i, expected := range basicRankCases {
+ t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
+ actual := BasicRank(i)
+ if expected != actual {
+ t.Errorf("BasicRank(%d) = %s, want %s", i, actual, expected)
+ }
+ })
+ }
+}
+
func mapEquals[K comparable, V comparable](a, b map[K]V) bool {
for k := range a {
if a[k] != b[k] {