Skip to content

Commit edff5a0

Browse files
mvrahdenboyan-soubachov
authored andcommitted
fix funtion name
1 parent 5c61ef9 commit edff5a0

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

assert/assertions.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ func NotEqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...inte
718718
// return (false, false) if impossible.
719719
// return (true, false) if element was not found.
720720
// return (true, true) if element was found.
721-
func includeElement(list interface{}, element interface{}) (ok, found bool) {
721+
func containsElement(list interface{}, element interface{}) (ok, found bool) {
722722

723723
listValue := reflect.ValueOf(list)
724724
listType := reflect.TypeOf(list)
@@ -768,7 +768,7 @@ func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bo
768768
h.Helper()
769769
}
770770

771-
ok, found := includeElement(s, contains)
771+
ok, found := containsElement(s, contains)
772772
if !ok {
773773
return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...)
774774
}
@@ -791,7 +791,7 @@ func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{})
791791
h.Helper()
792792
}
793793

794-
ok, found := includeElement(s, contains)
794+
ok, found := containsElement(s, contains)
795795
if !ok {
796796
return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...)
797797
}
@@ -835,7 +835,7 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok
835835

836836
for i := 0; i < subsetValue.Len(); i++ {
837837
element := subsetValue.Index(i).Interface()
838-
ok, found := includeElement(list, element)
838+
ok, found := containsElement(list, element)
839839
if !ok {
840840
return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", list), msgAndArgs...)
841841
}
@@ -879,7 +879,7 @@ func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{})
879879

880880
for i := 0; i < subsetValue.Len(); i++ {
881881
element := subsetValue.Index(i).Interface()
882-
ok, found := includeElement(list, element)
882+
ok, found := containsElement(list, element)
883883
if !ok {
884884
return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", list), msgAndArgs...)
885885
}

assert/assertions_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -732,53 +732,53 @@ func TestNotSubsetNil(t *testing.T) {
732732
}
733733
}
734734

735-
func Test_includeElement(t *testing.T) {
735+
func Test_containsElement(t *testing.T) {
736736

737737
list1 := []string{"Foo", "Bar"}
738738
list2 := []int{1, 2}
739739
simpleMap := map[interface{}]interface{}{"Foo": "Bar"}
740740

741-
ok, found := includeElement("Hello World", "World")
741+
ok, found := containsElement("Hello World", "World")
742742
True(t, ok)
743743
True(t, found)
744744

745-
ok, found = includeElement(list1, "Foo")
745+
ok, found = containsElement(list1, "Foo")
746746
True(t, ok)
747747
True(t, found)
748748

749-
ok, found = includeElement(list1, "Bar")
749+
ok, found = containsElement(list1, "Bar")
750750
True(t, ok)
751751
True(t, found)
752752

753-
ok, found = includeElement(list2, 1)
753+
ok, found = containsElement(list2, 1)
754754
True(t, ok)
755755
True(t, found)
756756

757-
ok, found = includeElement(list2, 2)
757+
ok, found = containsElement(list2, 2)
758758
True(t, ok)
759759
True(t, found)
760760

761-
ok, found = includeElement(list1, "Foo!")
761+
ok, found = containsElement(list1, "Foo!")
762762
True(t, ok)
763763
False(t, found)
764764

765-
ok, found = includeElement(list2, 3)
765+
ok, found = containsElement(list2, 3)
766766
True(t, ok)
767767
False(t, found)
768768

769-
ok, found = includeElement(list2, "1")
769+
ok, found = containsElement(list2, "1")
770770
True(t, ok)
771771
False(t, found)
772772

773-
ok, found = includeElement(simpleMap, "Foo")
773+
ok, found = containsElement(simpleMap, "Foo")
774774
True(t, ok)
775775
True(t, found)
776776

777-
ok, found = includeElement(simpleMap, "Bar")
777+
ok, found = containsElement(simpleMap, "Bar")
778778
True(t, ok)
779779
False(t, found)
780780

781-
ok, found = includeElement(1433, "1")
781+
ok, found = containsElement(1433, "1")
782782
False(t, ok)
783783
False(t, found)
784784
}

0 commit comments

Comments
 (0)