Repository: bxcodec/faker
Pull request #9 (2017-10-26 04:09:00)

Repair test


Patch:
diff --git a/README.md b/README.md
index fc096cf..cfdf63d 100644
--- a/README.md
+++ b/README.md
@@ -41,7 +41,7 @@ Supported tag :
 * IP Address (IPV4 IPV6 )
 * Credit Card Type (VISA, MASTERCARD , AMERICAN EXPRESS ,DISCOVER)
 * Credit Card Number
-* Latitude and Longitude 
+* Latitude and Longitude
 
 ```go
 
@@ -139,12 +139,12 @@ Output :
 Bench To Generate Fake Data
 #### Without Tag
 ```bash
- BenchmarkFakerDataNOTTagged-4             500000              2871 ns/op             488 B/op         20 allocs/op
-
+BenchmarkFakerDataNOTTagged-4             500000              3049 ns/op             488 B/op         20 allocs/op
 ```
+
 #### Using Tag
 ```bash
- BenchmarkFakerDataTagged-4                300000              4041 ns/op             383 B/op         26 allocs/op
+ BenchmarkFakerDataTagged-4                100000             17470 ns/op             380 B/op         26 allocs/op
 ```
 
 ### MUST KNOW
diff --git a/faker.go b/faker.go
index 427e73a..755c7ec 100644
--- a/faker.go
+++ b/faker.go
@@ -12,7 +12,7 @@ import (
 )
 
 var src = rand.NewSource(time.Now().UnixNano())
-var mu =  &sync.Mutex{}
+var mu = &sync.Mutex{}
 
 const (
 	letterIdxBits      = 6                    // 6 bits to represent a letter index
@@ -57,7 +57,7 @@ var ErrUnsupportedKind = "Unsupported kind: %s"
 var ErrValueNotPtr = "Not a pointer value"
 
 // Error when tag not supported
-var ErrTagNotSupported = "String Tag not unsupported"
+var ErrTagNotSupported = "String Tag unsupported"
 
 // FakeData is the main function. Will generate a fake data based on your struct.  You can use this for automation testing, or anything that need automated data.
 // You don't need to Create your own data for your testing.


Test patch:
diff --git a/faker_test.go b/faker_test.go
index 43e38a6..3750f84 100644
--- a/faker_test.go
+++ b/faker_test.go
@@ -105,51 +105,51 @@ func TestSetDataIfArgumentNotPtr(t *testing.T) {
 	}
 }
 
-func TestSetDataIfArgumentPtr(t *testing.T)  {
+func TestSetDataIfArgumentPtr(t *testing.T) {
 	temp := &struct{}{}
 	if "Unsupported kind: ptr Change Without using * (pointer) in Field of *struct {}" != setData(reflect.ValueOf(&temp)).Error() {
 		t.Error("Exptected error Unsupported kind ptr")
 	}
 }
 
-func TestSetDataIfArgumentNotHaveReflect(t *testing.T)  {
+func TestSetDataIfArgumentNotHaveReflect(t *testing.T) {
 	temp := func() {}
 	if "Unsupported kind: func" != setData(reflect.ValueOf(&temp)).Error() {
 		t.Error("Exptected error Unsupported kind")
 	}
 }
 
-func TestSetDataErrorDataParseTag(t *testing.T)  {
-	temp := &struct{
+func TestSetDataErrorDataParseTag(t *testing.T) {
+	temp := &struct {
 		test string `faker:"test"`
 	}{}
-	if "String Tag not unsupported" != setData(reflect.ValueOf(temp)).Error() {
+	if "String Tag unsupported" != setData(reflect.ValueOf(temp)).Error() {
 		t.Error("Exptected error Unsupported tag")
 	}
 }
 
-func TestSetDataWithTagIfFirstArgumentNotPtr(t *testing.T)  {
+func TestSetDataWithTagIfFirstArgumentNotPtr(t *testing.T) {
 	temp := struct{}{}
 	if "Not a pointer value" != setDataWithTag(reflect.ValueOf(temp), "").Error() {
 		t.Error("Expected in arguments not ptr")
 	}
 }
 
-func TestSetDataWithTagIfFirstArgumentSlice(t *testing.T)  {
+func TestSetDataWithTagIfFirstArgumentSlice(t *testing.T) {
 	temp := []int{}
 	if setDataWithTag(reflect.ValueOf(&temp), "") != nil {
 		t.Error("Not expected errors if first argument slice type")
 	}
 }
 
-func TestSetDataWithTagIfFirstArgumentNotFound(t *testing.T)  {
+func TestSetDataWithTagIfFirstArgumentNotFound(t *testing.T) {
 	temp := struct{}{}
 	if setDataWithTag(reflect.ValueOf(&temp), "") != nil {
 		t.Error("First argument is struct type, expected return nil")
 	}
 }
 
-func TestUserDefinedFloatNotFoundTag(t *testing.T)  {
+func TestUserDefinedFloatNotFoundTag(t *testing.T) {
 	temp := struct{}{}
 
 	if userDefinedFloat(reflect.ValueOf(&temp), "") == nil {
diff --git a/internet_test.go b/internet_test.go
index 40dfbd3..a2a54d3 100644
--- a/internet_test.go
+++ b/internet_test.go
@@ -8,7 +8,7 @@ import (
 )
 
 func TestEmail(t *testing.T) {
-	if strings.Contains(getNetworker().Email(), "@") == false {
+	if !strings.Contains(getNetworker().Email(), "@") {
 		t.Error("Expected  email")
 	}
 }
@@ -30,7 +30,7 @@ func TestUrlOneVerbs(t *testing.T) {
 	urlFormats = []string{
 		"http://www.%s/"}
 
-	if strings.Contains(getNetworker().Url(), "http") == false {
+	if !strings.Contains(getNetworker().Url(), "http") {
 		t.Error("Expected get url")
 	}
 }
@@ -38,7 +38,7 @@ func TestUrlTwoVerbs(t *testing.T) {
 	urlFormats = []string{
 		"http://www.%s/%s"}
 
-	if strings.Contains(getNetworker().Url(), "http") == false {
+	if !strings.Contains(getNetworker().Url(), "http") {
 		t.Error("Expected get url")
 	}
 }