Files
codekata-golang/58_spiral_primes/main_test.go
2021-01-12 09:52:09 +08:00

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)
}
})
}
}