We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8e0f90 commit 1159e99Copy full SHA for 1159e99
property-base-test/roman_number_test.go
@@ -2,7 +2,9 @@ package roman_numerals
2
3
import (
4
"fmt"
5
+ "log"
6
"testing"
7
+ "testing/quick"
8
)
9
10
var cases = []struct {
@@ -62,3 +64,21 @@ func TestConvertingToArabic(t *testing.T) {
62
64
})
63
65
}
66
67
+
68
+func TestPropertiesOfConversion(t *testing.T) {
69
+ assertion := func(arabic int) bool {
70
+ if arabic < 0 || arabic > 3999 {
71
+ log.Println(arabic)
72
+ return true
73
+ }
74
+ roman := ConvertToRoman(arabic)
75
+ fromRoman := ConvertToArabic(roman)
76
+ return fromRoman == arabic
77
78
79
+ if err := quick.Check(assertion, &quick.Config{
80
+ MaxCount: 1000,
81
+ }); err != nil {
82
+ t.Error("failed checks", err)
83
84
+}
0 commit comments