github.com/seeker-insurance/kit@v0.0.13/str/normalize_ascii_test.go (about)

     1  package str
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestRemoveASCIIWhitespace(t *testing.T) {
     8  	type args struct {
     9  		s string
    10  	}
    11  	tests := []struct {
    12  		name string
    13  		args args
    14  		want string
    15  	}{
    16  		{"spaces", args{"foo   "}, "foo"},
    17  		{"tabs", args{"\tbar\t"}, "bar"},
    18  		{"newlines", args{"\nba\nz\n"}, "baz"},
    19  		{"none", args{"python"}, "python"},
    20  		{"all", args{ASCIIWhitespace}, ""},
    21  	}
    22  
    23  	for _, tt := range tests {
    24  		t.Run(tt.name, func(t *testing.T) {
    25  			if got := RemoveASCIIWhiteSpace(tt.args.s); got != tt.want {
    26  				t.Errorf("RemoveWhitespace() = %v, want %v", got, tt.want)
    27  			}
    28  		})
    29  	}
    30  }
    31  
    32  func TestRemoveASCIIWhiteSpace(t *testing.T) {
    33  	type args struct {
    34  		s string
    35  	}
    36  	tests := []struct {
    37  		name string
    38  		args args
    39  		want string
    40  	}{
    41  	// TODO: Add test cases.
    42  	}
    43  	for _, tt := range tests {
    44  		t.Run(tt.name, func(t *testing.T) {
    45  			if got := RemoveASCIIWhiteSpace(tt.args.s); got != tt.want {
    46  				t.Errorf("RemoveASCIIWhiteSpace() = %v, want %v", got, tt.want)
    47  			}
    48  		})
    49  	}
    50  }
    51  
    52  func TestRemoveNonASCII(t *testing.T) {
    53  	type args struct {
    54  		s string
    55  	}
    56  	tests := []struct {
    57  		name string
    58  		args args
    59  		want string
    60  	}{
    61  	// TODO: Add test cases.
    62  	}
    63  	for _, tt := range tests {
    64  		t.Run(tt.name, func(t *testing.T) {
    65  			if got := RemoveNonASCII(tt.args.s); got != tt.want {
    66  				t.Errorf("RemoveNonASCII() = %v, want %v", got, tt.want)
    67  			}
    68  		})
    69  	}
    70  }