File: session_setup_test.go

package info (click to toggle)
bettercap 2.33.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,668 kB
  • sloc: sh: 154; makefile: 76; python: 52; ansic: 9
file content (43 lines) | stat: -rw-r--r-- 851 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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)
			}
		})
	}
}