Skip to content

Commit 7159b0f

Browse files
authored
fix: failing assert in enums test on 32bit (#1634)
1 parent 28de14c commit 7159b0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

enums_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package swag
22

33
import (
44
"encoding/json"
5+
"math/bits"
56
"os"
67
"path/filepath"
78
"testing"
@@ -21,7 +22,7 @@ func TestParseGlobalEnums(t *testing.T) {
2122
assert.NoError(t, err)
2223
assert.Equal(t, string(expected), string(b))
2324
constsPath := "github.com/swaggo/swag/testdata/enums/consts"
24-
assert.Equal(t, 64, p.packages.packages[constsPath].ConstTable["uintSize"].Value)
25+
assert.Equal(t, bits.UintSize, p.packages.packages[constsPath].ConstTable["uintSize"].Value)
2526
assert.Equal(t, int32(62), p.packages.packages[constsPath].ConstTable["maxBase"].Value)
2627
assert.Equal(t, 8, p.packages.packages[constsPath].ConstTable["shlByLen"].Value)
2728
assert.Equal(t, 255, p.packages.packages[constsPath].ConstTable["hexnum"].Value)

0 commit comments

Comments
 (0)