Skip to content
Snippets Groups Projects
Commit 300a63bf authored by ko_oler's avatar ko_oler
Browse files

fix tests

parent 612be0c7
No related branches found
No related tags found
No related merge requests found
package field package field
import ( import (
"fmt"
"math" "math"
"reflect" "reflect"
"testing" "testing"
...@@ -91,32 +90,3 @@ func TestNumberField_Encode(t *testing.T) { ...@@ -91,32 +90,3 @@ func TestNumberField_Encode(t *testing.T) {
}) })
} }
} }
func TestNumberField_ConvertToInt64(t *testing.T) {
tests := []struct {
name string
number float64
want int64
}{
{
name: "float64 to int64",
number: 9223372036854775807.0,
want: 9223372036854775807,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
num := int64(tt.number)
if reflect.DeepEqual(num, tt.want) {
return
}
t.Errorf("Convert() got = %v, want %v", int64(tt.number), tt.want)
})
}
fmt.Println(math.MaxInt64)
fmt.Println(float64(math.MaxInt64))
r := float64(math.MaxInt64)
fmt.Println(int64(r))
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment