Skip to content

Commit c672d25

Browse files
committed
Test coverage
1 parent bae106c commit c672d25

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Fast text generator on a mask.
33

44
[![Go Report Card](https://goreportcard.com/badge/github.com/liderman/text-generator)](https://goreportcard.com/report/github.com/liderman/text-generator)
5+
[![codecov](https://codecov.io/gh/liderman/text-generator/branch/master/graph/badge.svg?token=53NH949TQY)](https://codecov.io/gh/liderman/text-generator)
56
[![Go Reference](https://pkg.go.dev/badge/github.com/liderman/text-generator.svg)](https://pkg.go.dev/github.com/liderman/text-generator)
67
[![Release](https://img.shields.io/github/release/liderman/text-generator.svg?style=flat-square)](https://github.com/liderman/text-generator/releases/latest)
78

cached-text-generator_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,11 @@ func TestCustomCachedGenerate(t *testing.T) {
3232
assert.Equal(t, result, prevResult)
3333
}
3434
}
35+
36+
func TestCachedTextGenerator_CustomGenerateConfig(t *testing.T) {
37+
tg := New()
38+
NewCached(tg, 10).Configure('[', ']', '!')
39+
assert.Equal(t, tg.startTag, "[")
40+
assert.Equal(t, tg.endTag, "]")
41+
assert.Equal(t, tg.separator, "!")
42+
}

text-generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type TextGenerator struct {
1919
}
2020

2121
// New returns a new instance a text generator.
22-
func New() GeneratorInterface {
22+
func New() *TextGenerator {
2323
rand.Seed(time.Now().UnixNano())
2424
return &TextGenerator{
2525
startTag: '{',

0 commit comments

Comments
 (0)