package sapin import ( "fmt" "testing" ) func TestSapin(t *testing.T) { tt := []struct { size int want string }{ {1, ` * *** ***** ******* ||| `}, {2, ` * *** ***** ******* ***** ******* ********* *********** ************* ||| ||| `}, {3, ` * *** ***** ******* ***** ******* ********* *********** ************* ********* *********** ************* *************** ***************** ******************* ||| ||| ||| `}, {4, ` * *** ***** ******* ***** ******* ********* *********** ************* ********* *********** ************* *************** ***************** ******************* ************* *************** ***************** ******************* ********************* *********************** ************************* ||| ||| ||| ||| `}, {5, ` * *** ***** ******* ***** ******* ********* *********** ************* ********* *********** ************* *************** ***************** ******************* ************* *************** ***************** ******************* ********************* *********************** ************************* ***************** ******************* ********************* *********************** ************************* *************************** ***************************** ******************************* ||| ||| ||| ||| ||| `}, // {50, ``}, // {51, ``}, } for _, tc := range tt { name := fmt.Sprintf("%d", tc.size) t.Run(name, func(t *testing.T) { got := Sapin(tc.size) want := tc.want[1:] if got != want { t.Errorf("expected \n%s\n, got \n%s\n.", want, got) } }) } }