Skip to content

Instantly share code, notes, and snippets.

@haru01
Last active May 30, 2017 00:38
Show Gist options
  • Save haru01/f30006e377620330b38d41ebc3f4d13e to your computer and use it in GitHub Desktop.
Save haru01/f30006e377620330b38d41ebc3f4d13e to your computer and use it in GitHub Desktop.
package roman
import "testing"
func TestToRoman(t *testing.T) {
testCases := []struct {
name string
in uint16
want string
}{
{"1=>Iと変換できること", 1, "I"},
// {"2=>IIと変換できること", 2, "II"},
{"5=>Vと変換できること", 5, "V"},
}
for _, test := range testCases {
t.Run(test.name, func(t *testing.T) {
if got := ToRoman(test.in); got != test.want {
t.Errorf("ToRoman(%v) = got %v want %v", test.in, got, test.want)
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment