-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcolor_test.go
More file actions
54 lines (45 loc) · 721 Bytes
/
color_test.go
File metadata and controls
54 lines (45 loc) · 721 Bytes
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
44
45
46
47
48
49
50
51
52
53
54
package gofaker
import (
"fmt"
"testing"
)
func ExampleColor() {
Seed(11)
fmt.Println(Color())
// Output: MediumOrchid
}
func BenchmarkColor(b *testing.B) {
for i := 0; i < b.N; i++ {
Color()
}
}
func ExampleSafeColor() {
Seed(11)
fmt.Println(SafeColor())
// Output: black
}
func BenchmarkSafeColor(b *testing.B) {
for i := 0; i < b.N; i++ {
SafeColor()
}
}
func ExampleHexColor() {
Seed(11)
fmt.Println(HexColor())
// Output: #a99fb4
}
func BenchmarkHexColor(b *testing.B) {
for i := 0; i < b.N; i++ {
HexColor()
}
}
func ExampleRGBColor() {
Seed(11)
fmt.Println(RGBColor())
// Output: [152 23 53]
}
func BenchmarkRGBColor(b *testing.B) {
for i := 0; i < b.N; i++ {
RGBColor()
}
}