使,这一切注定要改变格林一家的命运。", " GoldThepWhenJingdou", 5, 0}, } for _, tc := range testcases { if got := StrTranslate(tc.text); got != tc.want { t.Errorf("func StrTranslate, param text: %q, want: %q, got: %q", tc.text, tc.want, got) } }}func TestSort(t *testing.T) { testcases := []struct { nums []int want []int }{ {[]int{3, 2, 1, 5, 4}, []int{1, 2, 3, 4, 5}}, } for _, tc := range testcases { if got := BubbleSort(tc.nums); !cmp.Equal(got, tc.want) { t.Errorf("func Sort, param nums: %v, want: %v, got: %v", tc.nums, tc.want, got) } if got := SelectSort(tc.nums); !cmp.Equal(got, tc.want) { t.Errorf("func Sort, param nums: %v, want: %v, got: %v", tc.nums, tc.want, got) } if got := InsertSort(tc.nums); !cmp.Equal(got, tc.want) { t.Errorf("func Sort, param nums: %v, want: %v, got: %v", tc.nums, tc.want, got) } }}