File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed
Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -115,3 +115,14 @@ func Test_Exists(t *testing.T) {
115115
116116 assert .True (t , is )
117117}
118+
119+ func BenchmarkValidateCorrect (b * testing.B ) {
120+ for i := 0 ; i < b .N ; i ++ {
121+ _ , _ = Validate ("044525225" )
122+ }
123+ }
124+ func BenchmarkGenerate (b * testing.B ) {
125+ for i := 0 ; i < b .N ; i ++ {
126+ Generate ()
127+ }
128+ }
Original file line number Diff line number Diff line change @@ -136,6 +136,18 @@ func TestGenerate(t *testing.T) {
136136 })
137137}
138138
139+ func BenchmarkValidateCorrectLegal (b * testing.B ) {
140+ for i := 0 ; i < b .N ; i ++ {
141+ _ , _ = Validate ("7707083893" )
142+ }
143+ }
144+
145+ func BenchmarkValidateCorrectPhysical (b * testing.B ) {
146+ for i := 0 ; i < b .N ; i ++ {
147+ _ , _ = Validate ("526317984689" )
148+ }
149+ }
150+
139151func BenchmarkGenerate (b * testing.B ) {
140152 for i := 0 ; i < b .N ; i ++ {
141153 Generate ()
Original file line number Diff line number Diff line change @@ -136,3 +136,14 @@ func Test_Generate(t *testing.T) {
136136
137137 assert .True (t , isValid )
138138}
139+
140+ func BenchmarkValidateCorrect (b * testing.B ) {
141+ for i := 0 ; i < b .N ; i ++ {
142+ _ , _ = Validate ("775001001" )
143+ }
144+ }
145+ func BenchmarkGenerate (b * testing.B ) {
146+ for i := 0 ; i < b .N ; i ++ {
147+ Generate ()
148+ }
149+ }
You can’t perform that action at this time.
0 commit comments