From 58df2b08f57076800745009aa4d562ef77ba6f9c Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Tue, 15 Aug 2023 19:39:51 -0500 Subject: Add 2345 Score to output --- factors/factors_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'factors/factors_test.go') 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] { -- cgit v1.2.3