Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
300a63bf
Commit
300a63bf
authored
1 year ago
by
ko_oler
Browse files
Options
Downloads
Patches
Plain Diff
fix tests
parent
612be0c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/schema/field/number_test.go
+0
-30
0 additions, 30 deletions
pkg/schema/field/number_test.go
with
0 additions
and
30 deletions
pkg/schema/field/number_test.go
+
0
−
30
View file @
300a63bf
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
))
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment