(t *testing.T)
| 713 | } |
| 714 | |
| 715 | func TestExpr(t *testing.T) { |
| 716 | date := time.Date(2017, time.October, 23, 18, 30, 0, 0, time.UTC) |
| 717 | oneDay, _ := time.ParseDuration("24h") |
| 718 | timeNowPlusOneDay := date.Add(oneDay) |
| 719 | |
| 720 | env := mock.Env{ |
| 721 | Embed: mock.Embed{}, |
| 722 | Ambiguous: "", |
| 723 | Any: nil, |
| 724 | Bool: true, |
| 725 | Float: 0, |
| 726 | Int64: 0, |
| 727 | Int32: 0, |
| 728 | Int: 0, |
| 729 | One: 1, |
| 730 | Two: 2, |
| 731 | Uint32: 0, |
| 732 | String: "string", |
| 733 | BoolPtr: nil, |
| 734 | FloatPtr: nil, |
| 735 | IntPtr: nil, |
| 736 | IntPtrPtr: nil, |
| 737 | StringPtr: nil, |
| 738 | Foo: mock.Foo{ |
| 739 | Value: "foo", |
| 740 | Bar: mock.Bar{ |
| 741 | Baz: "baz", |
| 742 | }, |
| 743 | }, |
| 744 | Abstract: nil, |
| 745 | ArrayOfAny: nil, |
| 746 | ArrayOfInt: []int{1, 2, 3, 4, 5}, |
| 747 | ArrayOfFoo: []*mock.Foo{{Value: "foo"}, {Value: "bar"}, {Value: "baz"}}, |
| 748 | MapOfFoo: nil, |
| 749 | MapOfAny: nil, |
| 750 | FuncParam: nil, |
| 751 | FuncParamAny: nil, |
| 752 | FuncTooManyReturns: nil, |
| 753 | FuncNamed: nil, |
| 754 | NilAny: nil, |
| 755 | NilFn: nil, |
| 756 | NilStruct: nil, |
| 757 | Variadic: func(head int, xs ...int) bool { |
| 758 | sum := 0 |
| 759 | for _, x := range xs { |
| 760 | sum += x |
| 761 | } |
| 762 | return head == sum |
| 763 | }, |
| 764 | Fast: nil, |
| 765 | Time: date, |
| 766 | TimePlusDay: timeNowPlusOneDay, |
| 767 | Duration: oneDay, |
| 768 | } |
| 769 | |
| 770 | tests := []struct { |
| 771 | code string |
| 772 | want any |
nothing calls this directly
no test coverage detected
searching dependent graphs…