...

Source file src/github.com/chaos-mesh/chaos-mesh/cmd/chaos-builder/workflow_test.go

Documentation: github.com/chaos-mesh/chaos-mesh/cmd/chaos-builder

     1  // Copyright 2021 Chaos Mesh Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  package main
    15  
    16  import "testing"
    17  
    18  func Test_lowercaseCamelCase(t *testing.T) {
    19  	type args struct {
    20  		str string
    21  	}
    22  	tests := []struct {
    23  		name string
    24  		args args
    25  		want string
    26  	}{
    27  		{
    28  			name: "common",
    29  			args: args{
    30  				str: "PodChaos",
    31  			},
    32  			want: "podChaos",
    33  		}, {
    34  			name: "ALLCAP",
    35  			args: args{
    36  				str: "DNSChaos",
    37  			},
    38  			want: "dnsChaos",
    39  		}, {
    40  			name: "ALLCAP",
    41  			args: args{
    42  				str: "JVMChaos",
    43  			},
    44  			want: "jvmChaos",
    45  		}, {
    46  			name: "workflow",
    47  			args: args{
    48  				str: "Workflow",
    49  			},
    50  			want: "workflow",
    51  		},
    52  		// TODO: Add test cases.
    53  	}
    54  	for _, tt := range tests {
    55  		t.Run(tt.name, func(t *testing.T) {
    56  			if got := lowercaseCamelCase(tt.args.str); got != tt.want {
    57  				t.Errorf("lowercaseCamelCase() = %v, want %v", got, tt.want)
    58  			}
    59  		})
    60  	}
    61  }
    62