(t *testing.T)
| 687 | } |
| 688 | |
| 689 | func Test_includeElement(t *testing.T) { |
| 690 | |
| 691 | list1 := []string{"Foo", "Bar"} |
| 692 | list2 := []int{1, 2} |
| 693 | simpleMap := map[interface{}]interface{}{"Foo": "Bar"} |
| 694 | |
| 695 | ok, found := includeElement("Hello World", "World") |
| 696 | True(t, ok) |
| 697 | True(t, found) |
| 698 | |
| 699 | ok, found = includeElement(list1, "Foo") |
| 700 | True(t, ok) |
| 701 | True(t, found) |
| 702 | |
| 703 | ok, found = includeElement(list1, "Bar") |
| 704 | True(t, ok) |
| 705 | True(t, found) |
| 706 | |
| 707 | ok, found = includeElement(list2, 1) |
| 708 | True(t, ok) |
| 709 | True(t, found) |
| 710 | |
| 711 | ok, found = includeElement(list2, 2) |
| 712 | True(t, ok) |
| 713 | True(t, found) |
| 714 | |
| 715 | ok, found = includeElement(list1, "Foo!") |
| 716 | True(t, ok) |
| 717 | False(t, found) |
| 718 | |
| 719 | ok, found = includeElement(list2, 3) |
| 720 | True(t, ok) |
| 721 | False(t, found) |
| 722 | |
| 723 | ok, found = includeElement(list2, "1") |
| 724 | True(t, ok) |
| 725 | False(t, found) |
| 726 | |
| 727 | ok, found = includeElement(simpleMap, "Foo") |
| 728 | True(t, ok) |
| 729 | True(t, found) |
| 730 | |
| 731 | ok, found = includeElement(simpleMap, "Bar") |
| 732 | True(t, ok) |
| 733 | False(t, found) |
| 734 | |
| 735 | ok, found = includeElement(1433, "1") |
| 736 | False(t, ok) |
| 737 | False(t, found) |
| 738 | } |
| 739 | |
| 740 | func TestElementsMatch(t *testing.T) { |
| 741 | mockT := new(testing.T) |
nothing calls this directly
no test coverage detected
searching dependent graphs…