MCPcopy Create free account
hub / github.com/Pallinder/go-randomdata / TestTitle

Function TestTitle

random_data_test.go:33–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestTitle(t *testing.T) {
34 t.Log("TestTitle")
35 titleMale := Title(Male)
36 titleFemale := Title(Female)
37 randomTitle := Title(100)
38
39 if !findInSlice(jsonData.MaleTitles, titleMale) {
40 t.Error("titleMale empty or not in male titles")
41 }
42
43 if !findInSlice(jsonData.FemaleTitles, titleFemale) {
44 t.Error("firstNameFemale empty or not in female titles")
45 }
46
47 names := make([]string, len(jsonData.MaleTitles)+len(jsonData.FemaleTitles))
48 names = append(names, jsonData.MaleTitles...)
49 names = append(names, jsonData.FemaleTitles...)
50 if !findInSlice(names, randomTitle) {
51 t.Error("randomName empty or not in male and female titles")
52 }
53}
54
55func TestRandomStringDigits(t *testing.T) {
56 t.Log("TestRandomStringDigits")

Callers

nothing calls this directly

Calls 2

TitleFunction · 0.85
findInSliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…