sort_things_test.go 589 B

123456789101112131415161718192021222324252627282930
  1. package sort_things
  2. import (
  3. "reflect"
  4. "testing"
  5. )
  6. func TestSortStringSliceByLength(t *testing.T) {
  7. type args struct {
  8. m []string
  9. }
  10. tests := []struct {
  11. name string
  12. args args
  13. want PathSlices
  14. }{
  15. {name: "00", args: args{m: []string{"1", "12", "123"}}, want: PathSlices{
  16. PathSlice{"123"},
  17. PathSlice{"12"},
  18. PathSlice{"1"},
  19. }},
  20. }
  21. for _, tt := range tests {
  22. t.Run(tt.name, func(t *testing.T) {
  23. if got := SortStringSliceByLength(tt.args.m); !reflect.DeepEqual(got, tt.want) {
  24. t.Errorf("SortStringSliceByLength() = %v, want %v", got, tt.want)
  25. }
  26. })
  27. }
  28. }