Skip to content

Commit

Permalink
add 4 unit test case for int*
Browse files Browse the repository at this point in the history
  • Loading branch information
shockerli committed Jan 5, 2022
1 parent 5b2d0e2 commit 32ee947
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![PkgGoDev](https://pkg.go.dev/badge/github.com/shockerli/cvt)](https://pkg.go.dev/github.com/shockerli/cvt)
[![Go Report Card](https://goreportcard.com/badge/github.com/shockerli/cvt)](https://goreportcard.com/report/github.com/shockerli/cvt)
[![Build Status](https://travis-ci.com/shockerli/cvt.svg?branch=master)](https://travis-ci.com/shockerli/cvt)
![GitHub top language](https://img.shields.io/github/languages/top/shockerli/cvt)
[![codecov](https://codecov.io/gh/shockerli/cvt/branch/master/graph/badge.svg)](https://codecov.io/gh/shockerli/cvt)
![GitHub](https://img.shields.io/github/license/shockerli/cvt)
[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)
Expand Down
1 change: 0 additions & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![PkgGoDev](https://pkg.go.dev/badge/github.com/shockerli/cvt)](https://pkg.go.dev/github.com/shockerli/cvt)
[![Go Report Card](https://goreportcard.com/badge/github.com/shockerli/cvt)](https://goreportcard.com/report/github.com/shockerli/cvt)
[![Build Status](https://travis-ci.com/shockerli/cvt.svg?branch=master)](https://travis-ci.com/shockerli/cvt)
![GitHub top language](https://img.shields.io/github/languages/top/shockerli/cvt)
[![codecov](https://codecov.io/gh/shockerli/cvt/branch/master/graph/badge.svg)](https://codecov.io/gh/shockerli/cvt)
![GitHub](https://img.shields.io/github/license/shockerli/cvt)
[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)
Expand Down
37 changes: 36 additions & 1 deletion int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,8 @@ func TestUint64E(t *testing.T) {
{"8", 8, false},
{"8.00", 8, false},
{"8.01", 8, false},
{"00100", 100, false},
{"00100.01", 100, false},
{[]byte("8"), 8, false},
{[]byte("8.00"), 8, false},
{[]byte("8.01"), 8, false},
Expand Down Expand Up @@ -1098,6 +1100,8 @@ func TestUint32E(t *testing.T) {
{"8", 8, false},
{"8.00", 8, false},
{"8.01", 8, false},
{"00100", 100, false},
{"00100.01", 100, false},
{nil, 0, false},
{aliasTypeInt0, 0, false},
{&aliasTypeInt0, 0, false},
Expand Down Expand Up @@ -1212,6 +1216,8 @@ func TestUint16E(t *testing.T) {
{"8", 8, false},
{"8.00", 8, false},
{"8.01", 8, false},
{"00100", 100, false},
{"00100.01", 100, false},
{nil, 0, false},
{aliasTypeInt0, 0, false},
{&aliasTypeInt0, 0, false},
Expand Down Expand Up @@ -1328,6 +1334,8 @@ func TestUint8E(t *testing.T) {
{"8", 8, false},
{"8.00", 8, false},
{"8.01", 8, false},
{"00100", 100, false},
{"00100.01", 100, false},
{nil, 0, false},
{aliasTypeInt0, 0, false},
{&aliasTypeInt0, 0, false},
Expand Down Expand Up @@ -1444,6 +1452,8 @@ func TestUintE(t *testing.T) {
{"8", 8, false},
{"8.00", 8, false},
{"8.01", 8, false},
{"00100", 100, false},
{"00100.01", 100, false},
{uint64(math.MaxUint32), uint(math.MaxUint32), false},
{uint32(math.MaxUint32), uint(math.MaxUint32), false},
{nil, 0, false},
Expand Down Expand Up @@ -1567,11 +1577,17 @@ func TestInt64E(t *testing.T) {
{"8", 8, false},
{"8.00", 8, false},
{"8.01", 8, false},
{"00100", 100, false},
{"-00100", -100, false},
{"00100.00", 100, false},
{"-00100.01", -100, false},
{[]byte("-8"), -8, false},
{[]byte("-8.01"), -8, false},
{[]byte("8"), 8, false},
{[]byte("8.00"), 8, false},
{[]byte("8.01"), 8, false},
{math.MaxInt64, math.MaxInt64, false},
{math.MinInt64, math.MinInt64, false},
{uint32(math.MaxUint32), int64(math.MaxUint32), false},
{nil, 0, false},
{aliasTypeInt0, 0, false},
Expand Down Expand Up @@ -1689,12 +1705,17 @@ func TestInt32E(t *testing.T) {
{"8", 8, false},
{"8.00", 8, false},
{"8.01", 8, false},
{"00100", 100, false},
{"-00100", -100, false},
{"00100.00", 100, false},
{"-00100.01", -100, false},
{[]byte("-8"), -8, false},
{[]byte("-8.01"), -8, false},
{[]byte("8"), 8, false},
{[]byte("8.00"), 8, false},
{[]byte("8.01"), 8, false},
{math.MaxInt32, int32(math.MaxInt32), false},
{math.MinInt32, int32(math.MinInt32), false},
{nil, 0, false},
{aliasTypeInt0, 0, false},
{&aliasTypeInt0, 0, false},
Expand Down Expand Up @@ -1808,12 +1829,17 @@ func TestInt16E(t *testing.T) {
{"8", 8, false},
{"8.00", 8, false},
{"8.01", 8, false},
{"00100", 100, false},
{"-00100", -100, false},
{"00100.00", 100, false},
{"-00100.01", -100, false},
{[]byte("-8"), -8, false},
{[]byte("-8.01"), -8, false},
{[]byte("8"), 8, false},
{[]byte("8.00"), 8, false},
{[]byte("8.01"), 8, false},
{math.MaxInt16, int16(math.MaxInt16), false},
{math.MinInt16, int16(math.MinInt16), false},
{nil, 0, false},
{aliasTypeInt0, 0, false},
{&aliasTypeInt0, 0, false},
Expand Down Expand Up @@ -1929,12 +1955,17 @@ func TestInt8E(t *testing.T) {
{"8", 8, false},
{"8.00", 8, false},
{"8.01", 8, false},
{"00100", 100, false},
{"-00100", -100, false},
{"00100.00", 100, false},
{"-00100.01", -100, false},
{[]byte("-8"), -8, false},
{[]byte("-8.01"), -8, false},
{[]byte("8"), 8, false},
{[]byte("8.00"), 8, false},
{[]byte("8.01"), 8, false},
{int8(math.MaxInt8), math.MaxInt8, false},
{int8(math.MinInt8), math.MinInt8, false},
{nil, 0, false},
{aliasTypeInt0, 0, false},
{&aliasTypeInt0, 0, false},
Expand Down Expand Up @@ -2051,12 +2082,16 @@ func TestIntE(t *testing.T) {
{"8", 8, false},
{"8.00", 8, false},
{"8.01", 8, false},
{"00100", 100, false},
{"-00100", -100, false},
{"00100.00", 100, false},
{"-00100.01", -100, false},
{[]byte("-8"), -8, false},
{[]byte("-8.01"), -8, false},
{[]byte("8"), 8, false},
{[]byte("8.00"), 8, false},
{[]byte("8.01"), 8, false},
{int(math.MaxInt32), int(math.MaxInt32), false},
{math.MaxInt32, math.MaxInt32, false},
{nil, 0, false},
{aliasTypeInt0, 0, false},
{&aliasTypeInt0, 0, false},
Expand Down

0 comments on commit 32ee947

Please sign in to comment.