mirror of
https://github.com/cubixle/codekata-golang.git
synced 2026-05-01 00:48:45 +01:00
20210112
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func Test_primeRatio(t *testing.T) {
|
||||
type args struct {
|
||||
nums []int
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
want float64
|
||||
}{
|
||||
{
|
||||
"test1",
|
||||
args{[]int{2, 3, 5, 8}},
|
||||
0.75,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := primeRatio(tt.args.nums); got != tt.want {
|
||||
t.Errorf("primeRatio() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user