-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtransform_test.go
41 lines (31 loc) · 1.26 KB
/
transform_test.go
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
package passit
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/text/language"
)
func TestLowerCase(t *testing.T) {
tr := newTestRand()
pass, err := LowerCase(Repeat(LatinMixed, "", 25)).Password(tr)
require.NoError(t, err)
assert.Equal(t, "yxishgyluarukywwtcxdjirmd", pass)
}
func TestUpperCase(t *testing.T) {
tr := newTestRand()
pass, err := UpperCase(Repeat(LatinMixed, "", 25)).Password(tr)
require.NoError(t, err)
assert.Equal(t, "YXISHGYLUARUKYWWTCXDJIRMD", pass)
}
func TestTitleCase(t *testing.T) {
tr := newTestRand()
pass, err := TitleCase(Repeat(OrchardStreetLong, " ", 10), language.English).Password(tr)
require.NoError(t, err)
assert.Equal(t, "Agreed Stopping Brilliant Elongated Richness Populous Sprung Grassland Stamens Dined", pass)
pass, err = TitleCase(Repeat(OrchardStreetLong, "-", 10), language.English).Password(tr)
require.NoError(t, err)
assert.Equal(t, "Emphasizes-Weaving-Pickup-Cascades-Newborn-Provider-Noisy-Retailer-Compromise-Inventors", pass)
pass, err = TitleCase(Repeat(OrchardStreetLong, "_", 10), language.English).Password(tr)
require.NoError(t, err)
assert.Equal(t, "Biplane_kingship_ambient_altered_injustices_precedes_yearning_kitten_chop_carefully", pass)
}