Skip to content

Commit

Permalink
Add test for containsCapitals function
Browse files Browse the repository at this point in the history
  • Loading branch information
Edznux committed Oct 25, 2018
1 parent ac37354 commit d5f13f7
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions session/session_setup_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package session

import "testing"

func Test_containsCapitals(t *testing.T) {
type args struct {
s string
}
tests := []struct {
name string
args args
want bool
}{
{
name: "Test all alpha lowercase",
args: args{s: "abcdefghijklmnopqrstuvwxyz"},
want: false,
},
{
name: "Test all alpha uppercase",
args: args{s: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"},
want: true,
},
{
name: "Test special chars",
args: args{s: "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"},
want: false,
},
// Add test for UTF8 ?
// {
// name: "Test special UTF-8 chars",
// args: args{s: "€©¶αϚϴЈ"},
// want: false,
// },
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := containsCapitals(tt.args.s); got != tt.want {
t.Errorf("containsCapitals() = %v, want %v", got, tt.want)
}
})
}
}

0 comments on commit d5f13f7

Please sign in to comment.