diff --git a/README.md b/README.md index bf9a759..4e8b9e3 100644 --- a/README.md +++ b/README.md @@ -1 +1,15 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/tardisx/haiku-detector.svg)](https://pkg.go.dev/github.com/tardisx/haiku-detector) + + + import "github.com/tardisx/haiku-detector" + + haiku := haiku.Find("haiku can be found wherever you are looking with help of some code") + + if len(haiku) > 0 { + println(haiku[0].String()) + } + + // haiku can be found + // wherever you are looking + // with help of some code + diff --git a/haiku_test.go b/haiku_test.go index 1875edd..a81c25d 100644 --- a/haiku_test.go +++ b/haiku_test.go @@ -117,6 +117,14 @@ Memory held tight, swept away in quiet dusk, Go frees what I leave.` another waits in silence, they meet, work is done`, out[2].String()) } + + h := Find("haiku can be found wherever you are looking with help of some code") + if assert.Len(t, h, 1) { + assert.Equal(t, `haiku can be found +wherever you are looking +with help of some code`, h[0].String()) + } + } func FuzzHaikuFromSentence(f *testing.F) {