Files
appcore/ptr/ptr_test.go

37 lines
452 B
Go
Raw Normal View History

package ptr
import "testing"
func TestRefDeref(t *testing.T) {
a := 10
2026-02-20 16:11:11 +05:30
if Deref(new(a)) != a {
t.Log("a) had a issue")
return
}
b := 10.1
2026-02-20 16:11:11 +05:30
if Deref(new(b)) != b {
t.Log("b) had a issue")
return
}
c := true
2026-02-20 16:11:11 +05:30
if Deref(new(c)) != c {
t.Log("c) had a issue")
return
}
d := "hello there"
2026-02-20 16:11:11 +05:30
if Deref(new(d)) != d {
t.Log("d) had a issue")
return
}
var e string
2026-02-20 16:11:11 +05:30
if Deref(new(e)) != e {
t.Log("e) had a issue")
return
}
}