...

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  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  //
    15  
    16  package main
    17  
    18  import "testing"
    19  
    20  func Test_lowercaseCamelCase(t *testing.T) {
    21  	type args struct {
    22  		str string
    23  	}
    24  	tests := []struct {
    25  		name string
    26  		args args
    27  		want string
    28  	}{
    29  		{
    30  			name: "common",
    31  			args: args{
    32  				str: "PodChaos",
    33  			},
    34  			want: "podChaos",
    35  		}, {
    36  			name: "ALLCAP",
    37  			args: args{
    38  				str: "DNSChaos",
    39  			},
    40  			want: "dnsChaos",
    41  		}, {
    42  			name: "ALLCAP",
    43  			args: args{
    44  				str: "JVMChaos",
    45  			},
    46  			want: "jvmChaos",
    47  		}, {
    48  			name: "workflow",
    49  			args: args{
    50  				str: "Workflow",
    51  			},
    52  			want: "workflow",
    53  		},
    54  		// TODO: Add test cases.
    55  	}
    56  	for _, tt := range tests {
    57  		t.Run(tt.name, func(t *testing.T) {
    58  			if got := lowercaseCamelCase(tt.args.str); got != tt.want {
    59  				t.Errorf("lowercaseCamelCase() = %v, want %v", got, tt.want)
    60  			}
    61  		})
    62  	}
    63  }
    64