39: integer right triangles

This commit is contained in:
VicRen
2020-11-10 08:55:35 +08:00
parent 14b7ca261f
commit f4a18fb4ed
2 changed files with 64 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
package main
import (
"reflect"
"testing"
)
func Test_findSolutionsFor(t *testing.T) {
type args struct {
n int
}
tests := []struct {
name string
args args
want [][]int
}{
{
"120",
args{120},
[][]int{{30, 40, 50}, {24, 45, 51}, {20, 48, 52}},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := findSolutionsFor(tt.args.n); !reflect.DeepEqual(got, tt.want) {
t.Errorf("findSolutionsFor() = %v, want %v", got, tt.want)
}
})
}
}