mirror of
https://github.com/cubixle/codekata-golang.git
synced 2026-04-24 23:04:42 +01:00
28 lines
426 B
Go
28 lines
426 B
Go
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)
|
|
}
|
|
})
|
|
}
|
|
}
|