TestCalcPoint(t *testing.T) { for _, tc := range []struct { name string text string oya bool tsumo bool res []int err error }{ { name: "タンヤオ", text: "s222678m333456p8 8", oya: false, tsumo: false, res: []int{1300}, err: nil, }, } { t.Run(tc.name, func(t *testing.T) { res, err := CalcPoint(tc.text, tc.oya, tc.tsumo) assert.Equal(t, tc.res, res) assert.Equal(t, tc.err, err) }) } }