num: make tests parallel
MODIFY
num/dual/dual_test.go
num/dual/dual_test.go
@@ -34,6 +34,7 @@ var formatTests = []struct {
}
func TestFormat(t *testing.T) {
+ t.Parallel()
for _, test := range formatTests {
got := fmt.Sprintf(test.format, test.d)
if got != test.want {
@@ -234,6 +235,7 @@ var dualTests = []struct {
}
func TestDual(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, test := range dualTests {
for _, x := range test.x {
@@ -377,6 +379,7 @@ var powRealTests = []struct {
}
func TestPowReal(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, test := range powRealTests {
got := PowReal(test.d, test.p)

MODIFY
num/dualcmplx/dual_test.go
num/dualcmplx/dual_test.go
@@ -35,6 +35,7 @@ var formatTests = []struct {
}
func TestFormat(t *testing.T) {
+ t.Parallel()
for _, test := range formatTests {
got := fmt.Sprintf(test.format, test.d)
if got != test.want {
@@ -149,6 +150,7 @@ var dualTests = []struct {
}
func TestNumber(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, test := range dualTests {
for _, x := range test.x {
@@ -179,6 +181,7 @@ var invTests = []Number{
}
func TestInv(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, x := range invTests {
got := Mul(x, Inv(x))
@@ -217,6 +220,7 @@ var expLogTests = []Number{
}
func TestExpLog(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, x := range expLogTests {
got := Log(Exp(x))
@@ -228,6 +232,7 @@ func TestExpLog(t *testing.T) {
}
func TestLogExp(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, x := range expLogTests {
if x.Real == 0 {
@@ -391,6 +396,7 @@ var powRealSpecialTests = []struct {
}
func TestPowRealSpecial(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, test := range powRealSpecialTests {
got := PowReal(test.d, test.p)
@@ -421,6 +427,7 @@ var powRealTests = []struct {
}
func TestPowReal(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range powRealTests {
got := PowReal(PowReal(test.d, test.p), 1/test.p)

MODIFY
num/dualquat/dual_test.go
num/dualquat/dual_test.go
@@ -35,6 +35,7 @@ var formatTests = []struct {
}
func TestFormat(t *testing.T) {
+ t.Parallel()
for _, test := range formatTests {
got := fmt.Sprintf(test.format, test.d)
if got != test.want {
@@ -112,6 +113,7 @@ var dualTests = []struct {
}
func TestNumber(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, test := range dualTests {
for _, x := range test.x {
@@ -142,6 +144,7 @@ var invTests = []Number{
}
func TestInv(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, x := range invTests {
got := Mul(x, Inv(x))
@@ -275,6 +278,7 @@ var powRealTests = []struct {
}
func TestPowReal(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, test := range powRealTests {
got := PowReal(test.d, test.p)

MODIFY
num/hyperdual/hyperdual_test.go
num/hyperdual/hyperdual_test.go
@@ -34,6 +34,7 @@ var formatTests = []struct {
}
func TestFormat(t *testing.T) {
+ t.Parallel()
for _, test := range formatTests {
got := fmt.Sprintf(test.format, test.h)
if got != test.want {
@@ -288,6 +289,7 @@ var hyperdualTests = []struct {
}
func TestHyperdual(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range hyperdualTests {
for _, x := range test.x {
@@ -454,6 +456,7 @@ var powRealTests = []struct {
}
func TestPowReal(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, test := range powRealTests {
got := PowReal(test.d, test.p)

MODIFY
num/quat/abs_test.go
num/quat/abs_test.go
@@ -23,6 +23,7 @@ var absTests = []struct {
}
func TestAbs(t *testing.T) {
+ t.Parallel()
for _, test := range absTests {
got := Abs(test.q)
if math.IsNaN(test.want) {

MODIFY
num/quat/conj_test.go
num/quat/conj_test.go
@@ -25,6 +25,7 @@ var invTests = []struct {
}
func TestInv(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range invTests {
got := Mul(test.q, Inv(test.q))

MODIFY
num/quat/exp_test.go
num/quat/exp_test.go
@@ -42,6 +42,7 @@ var expTests = []struct {
}
func TestExp(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range expTests {
got := Exp(test.q)
@@ -84,6 +85,7 @@ var logTests = []struct {
}
func TestLog(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range logTests {
got := Log(test.q)
@@ -178,6 +180,7 @@ var powTests = []struct {
}
func TestPow(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range powTests {
got := Pow(test.q, test.r)
@@ -220,6 +223,7 @@ var sqrtTests = []struct {
}
func TestSqrt(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range sqrtTests {
got := Sqrt(test.q)

MODIFY
num/quat/inf_test.go
num/quat/inf_test.go
@@ -38,6 +38,7 @@ var infTests = []struct {
}
func TestIsInf(t *testing.T) {
+ t.Parallel()
for _, test := range infTests {
got := IsInf(test.q)
if got != test.want {

MODIFY
num/quat/nan_test.go
num/quat/nan_test.go
@@ -33,6 +33,7 @@ var nanTests = []struct {
}
func TestIsNaN(t *testing.T) {
+ t.Parallel()
for _, test := range nanTests {
got := IsNaN(test.q)
if got != test.want {

MODIFY
num/quat/quat_test.go
num/quat/quat_test.go
@@ -69,6 +69,7 @@ var arithTests = []struct {
}
func TestArithmetic(t *testing.T) {
+ t.Parallel()
for _, test := range arithTests {
gotAdd := Add(test.x, test.y)
if gotAdd != test.wantAdd {
@@ -111,6 +112,7 @@ var formatTests = []struct {
}
func TestFormat(t *testing.T) {
+ t.Parallel()
for _, test := range formatTests {
got := fmt.Sprintf(test.format, test.q)
if got != test.want {
@@ -172,6 +174,7 @@ var parseTests = []struct {
}
func TestParse(t *testing.T) {
+ t.Parallel()
for _, test := range parseTests {
got, err := Parse(test.s)
if err != test.wantErr {

MODIFY
num/quat/trig_test.go
num/quat/trig_test.go
@@ -34,6 +34,7 @@ var sinTests = []struct {
}
func TestSin(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range sinTests {
got := Sin(test.q)
@@ -74,6 +75,7 @@ var sinhTests = []struct {
}
func TestSinh(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range sinhTests {
got := Sinh(test.q)
@@ -102,6 +104,7 @@ var cosTests = []struct {
}
func TestCos(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range cosTests {
got := Cos(test.q)
@@ -136,6 +139,7 @@ var coshTests = []struct {
}
func TestCosh(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range coshTests {
got := Cosh(test.q)
@@ -161,6 +165,7 @@ var tanTests = []struct {
}
func TestTan(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range tanTests {
got := Tan(test.q)
@@ -189,6 +194,7 @@ var tanhTests = []struct {
}
func TestTanh(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range tanhTests {
got := Tanh(test.q)
@@ -211,6 +217,7 @@ var asinTests = []struct {
}
func TestAsin(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range asinTests {
got := Asin(test.q)
@@ -248,6 +255,7 @@ var asinhTests = []struct {
}
func TestAsinh(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range asinhTests {
got := Asinh(test.q)
@@ -270,6 +278,7 @@ var acosTests = []struct {
}
func TestAcos(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range acosTests {
got := Acos(test.q)
@@ -301,6 +310,7 @@ var acoshTests = []struct {
}
func TestAcosh(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range acoshTests {
got := Acosh(test.q)
@@ -323,6 +333,7 @@ var atanTests = []struct {
}
func TestAtan(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range atanTests {
got := Atan(test.q)
@@ -359,6 +370,7 @@ var atanhTests = []struct {
}
func TestAtanh(t *testing.T) {
+ t.Parallel()
const tol = 1e-14
for _, test := range atanhTests {
got := Atanh(test.q)

num: make tests parallel