summaryrefslogtreecommitdiff
path: root/roman_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'roman_test.go')
-rw-r--r--roman_test.go30
1 files changed, 19 insertions, 11 deletions
diff --git a/roman_test.go b/roman_test.go
index 3bd96fc..4ad62cf 100644
--- a/roman_test.go
+++ b/roman_test.go
@@ -10,11 +10,25 @@ func TestRoman(t *testing.T) {
s string
}{
{0, ""},
- {1666, "MDCLXVI"},
- {1990, "MCMXC"},
- {2008, "MMVIII"},
- {3888, "MMMDCCCLXXXVIII"},
- {3999, "MMMCMXCIX"},
+ {1, "I"},
+ {2, "II"},
+ {3, "III"},
+ {5, "V"},
+ {8, "VIII"},
+ {13, "XIII"},
+ {21, "XXI"},
+ {34, "XXXIV"},
+ {55, "LV"},
+ {89, "LXXXIX"},
+ {100, "C"},
+ {200, "CC"},
+ {500, "D"},
+ {1e3 - 1, "CMXCIX"},
+ {2e3 - 1, "MCMXCIX"},
+ {4e3 - 1, "MMMCMXCIX"},
+ {1e6 - 1, "C̅M̅X̅C̅I̅X̅CMXCIX"},
+ {2e6 - 1, "M̅C̅M̅X̅C̅I̅X̅CMXCIX"},
+ {4e6 - 1, "M̅M̅M̅C̅M̅X̅C̅I̅X̅CMXCIX"},
}
for _, tc := range testCases {
t.Run(tc.s, func(t *testing.T) {
@@ -24,9 +38,3 @@ func TestRoman(t *testing.T) {
})
}
}
-
-func BenchmarkRoman(b *testing.B) {
- for i := 0; i < b.N; i++ {
- Roman(1666).String()
- }
-}