Skip to content

Commit

Permalink
internet - added space check test
Browse files Browse the repository at this point in the history
  • Loading branch information
brianvoe committed Feb 1, 2024
1 parent 2ca416e commit 3ea2e1a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gofakeit

import (
"fmt"
"strings"
"testing"
)

Expand Down Expand Up @@ -95,6 +96,17 @@ func ExampleFaker_URL() {
// Output: https://www.dynamiciterate.name/target/seamless
}

func TestURLValid(t *testing.T) {
for i := 0; i < 10000; i++ {
url := URL()

// Check if url has spaces in it
if strings.Contains(url, " ") {
t.Error("URL has spaces")
}
}
}

func BenchmarkURL(b *testing.B) {
b.Run("package", func(b *testing.B) {
for i := 0; i < b.N; i++ {
Expand Down

0 comments on commit 3ea2e1a

Please sign in to comment.