Skip to content

Commit 9c3083a

Browse files
committed
add missing tests
1 parent fe98c4b commit 9c3083a

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

pointer_test.go

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"reflect"
66
"testing"
7+
"time"
78
)
89

910
func Test_Pointer(t *testing.T) {
@@ -69,6 +70,61 @@ func Test_Pointer(t *testing.T) {
6970
fn: func(v interface{}) interface{} { return Int64(v.(int64)) },
7071
output: func() interface{} { i := int64(42); return &i }(),
7172
},
73+
{
74+
value: uintptr(42),
75+
fn: func(v interface{}) interface{} { return Uintptr(v.(uintptr)) },
76+
output: func() interface{} { i := uintptr(42); return &i }(),
77+
},
78+
{
79+
value: float32(42),
80+
fn: func(v interface{}) interface{} { return Float32(v.(float32)) },
81+
output: func() interface{} { i := float32(42); return &i }(),
82+
},
83+
{
84+
value: float64(42),
85+
fn: func(v interface{}) interface{} { return Float64(v.(float64)) },
86+
output: func() interface{} { i := float64(42); return &i }(),
87+
},
88+
{
89+
value: rune(42),
90+
fn: func(v interface{}) interface{} { return Rune(v.(rune)) },
91+
output: func() interface{} { i := rune(42); return &i }(),
92+
},
93+
{
94+
value: byte(42),
95+
fn: func(v interface{}) interface{} { return Byte(v.(byte)) },
96+
output: func() interface{} { i := byte(42); return &i }(),
97+
},
98+
{
99+
value: "42",
100+
fn: func(v interface{}) interface{} { return String(v.(string)) },
101+
output: func() interface{} { i := "42"; return &i }(),
102+
},
103+
{
104+
value: complex64(42),
105+
fn: func(v interface{}) interface{} { return Complex64(v.(complex64)) },
106+
output: func() interface{} { i := complex64(42); return &i }(),
107+
},
108+
{
109+
value: complex128(42),
110+
fn: func(v interface{}) interface{} { return Complex128(v.(complex128)) },
111+
output: func() interface{} { i := complex128(42); return &i }(),
112+
},
113+
{
114+
value: interface{}(42),
115+
fn: func(v interface{}) interface{} { return Interface(v) },
116+
output: func() interface{} { i := interface{}(42); return &i }(),
117+
},
118+
{
119+
value: time.Duration(42),
120+
fn: func(v interface{}) interface{} { return Duration(v.(time.Duration)) },
121+
output: func() interface{} { i := time.Duration(42); return &i }(),
122+
},
123+
{
124+
value: time.Time{},
125+
fn: func(v interface{}) interface{} { return Time(v.(time.Time)) },
126+
output: func() interface{} { i := time.Time{}; return &i }(),
127+
},
72128
}
73129

74130
for _, tc := range testCases {

0 commit comments

Comments
 (0)