(t *testing.T)
| 648 | } |
| 649 | |
| 650 | func Test_samePointers(t *testing.T) { |
| 651 | p := ptr(2) |
| 652 | |
| 653 | type args struct { |
| 654 | first interface{} |
| 655 | second interface{} |
| 656 | } |
| 657 | tests := []struct { |
| 658 | name string |
| 659 | args args |
| 660 | same BoolAssertionFunc |
| 661 | ok BoolAssertionFunc |
| 662 | }{ |
| 663 | { |
| 664 | name: "1 != 2", |
| 665 | args: args{first: 1, second: 2}, |
| 666 | same: False, |
| 667 | ok: False, |
| 668 | }, |
| 669 | { |
| 670 | name: "1 != 1 (not same ptr)", |
| 671 | args: args{first: 1, second: 1}, |
| 672 | same: False, |
| 673 | ok: False, |
| 674 | }, |
| 675 | { |
| 676 | name: "ptr(1) == ptr(1)", |
| 677 | args: args{first: p, second: p}, |
| 678 | same: True, |
| 679 | ok: True, |
| 680 | }, |
| 681 | { |
| 682 | name: "int(1) != float32(1)", |
| 683 | args: args{first: int(1), second: float32(1)}, |
| 684 | same: False, |
| 685 | ok: False, |
| 686 | }, |
| 687 | { |
| 688 | name: "array != slice", |
| 689 | args: args{first: [2]int{1, 2}, second: []int{1, 2}}, |
| 690 | same: False, |
| 691 | ok: False, |
| 692 | }, |
| 693 | { |
| 694 | name: "non-pointer vs pointer (1 != ptr(2))", |
| 695 | args: args{first: 1, second: p}, |
| 696 | same: False, |
| 697 | ok: False, |
| 698 | }, |
| 699 | { |
| 700 | name: "pointer vs non-pointer (ptr(2) != 1)", |
| 701 | args: args{first: p, second: 1}, |
| 702 | same: False, |
| 703 | ok: False, |
| 704 | }, |
| 705 | } |
| 706 | for _, tt := range tests { |
| 707 | t.Run(tt.name, func(t *testing.T) { |
nothing calls this directly
no test coverage detected