Files
Gumble-Backend/internal/util/int_test.go
Zane Walker 7e940c83a7
Some checks failed
Build & Test / build-test (push) Has been cancelled
Build & Test / swagger-codegen-cli (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
(Feat): Initial Commit
2026-07-03 19:41:31 +05:30

28 lines
499 B
Go

package util_test
import (
"math"
"testing"
"allaboutapps.dev/aw/go-starter/internal/util"
"github.com/stretchr/testify/assert"
)
func TestTypeConversions(t *testing.T) {
i := 19
if i > math.MaxInt32 || i < math.MinInt32 {
t.Error("Int value is out of range")
}
i64 := int64(i)
i32 := int32(i)
res := util.IntPtrToInt64Ptr(&i)
assert.Equal(t, &i64, res)
res2 := util.Int64PtrToIntPtr(&i64)
assert.Equal(t, &i, res2)
res3 := util.IntToInt32Ptr(i)
assert.Equal(t, &i32, res3)
}