...

Source file src/github.com/thoas/go-funk/permutation_test.go

Documentation: github.com/thoas/go-funk

     1  package funk
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  )
     7  
     8  func TestNextPermutation(t *testing.T) {
     9  	type args struct {
    10  		nums []int
    11  	}
    12  	tests := []struct {
    13  		name    string
    14  		args    args
    15  		wantErr bool
    16  	}{
    17  		{
    18  			name: "case1",
    19  			args: args{
    20  				nums: []int{1, 2, 3},
    21  			},
    22  			wantErr: false,
    23  		},
    24  	}
    25  	for _, tt := range tests {
    26  		t.Run(tt.name, func(t *testing.T) {
    27  			if err := NextPermutation(tt.args.nums); (err != nil) != tt.wantErr {
    28  				t.Errorf("NextPermutation() error = %v, wantErr %v", err, tt.wantErr)
    29  			} else {
    30  				fmt.Println(tt.args.nums)
    31  			}
    32  		})
    33  	}
    34  }
    35  

View as plain text