@@ -146,8 +146,8 @@ func TestSimple(t *testing.T) {
146
146
}
147
147
148
148
type myUnregistered struct {
149
- Bar map [string ]string `json:"bar"`
150
- Foo int `json:"foo"`
149
+ Bar map [int ]string `json:"bar"`
150
+ Foo int `json:"foo"`
151
151
}
152
152
153
153
func (c * myUnregistered ) CaveatType () CaveatType { return cavMyUnregistered }
@@ -156,7 +156,7 @@ func (c *myUnregistered) Prohibits(f Access) error { return nil }
156
156
157
157
func TestUnregisteredCaveatJSON (t * testing.T ) {
158
158
RegisterCaveatType (& myUnregistered {})
159
- c := & myUnregistered {Foo : 1 , Bar : map [string ]string {"a" : "b" }}
159
+ c := & myUnregistered {Foo : 1 , Bar : map [int ]string {1 : "b" }}
160
160
cs := NewCaveatSet (c )
161
161
b , err := json .Marshal (cs )
162
162
assert .NoError (t , err )
@@ -174,7 +174,7 @@ func TestUnregisteredCaveatJSON(t *testing.T) {
174
174
assert .Equal (t ,
175
175
any (map [string ]any {
176
176
"bar" : map [string ]any {
177
- "a " : "b" ,
177
+ "1 " : "b" ,
178
178
},
179
179
"foo" : float64 (1 ),
180
180
}),
@@ -199,7 +199,7 @@ func TestUnregisteredCaveatJSON(t *testing.T) {
199
199
200
200
func TestUnregisteredCaveatMsgpack (t * testing.T ) {
201
201
RegisterCaveatType (& myUnregistered {})
202
- c := & myUnregistered {Foo : 1 , Bar : map [string ]string {"a" : "b" }}
202
+ c := & myUnregistered {Foo : 1 , Bar : map [int ]string {1 : "b" }}
203
203
cs := NewCaveatSet (c )
204
204
b , err := cs .MarshalMsgpack ()
205
205
assert .NoError (t , err )
@@ -215,8 +215,8 @@ func TestUnregisteredCaveatMsgpack(t *testing.T) {
215
215
216
216
assert .Equal (t ,
217
217
any ([]any {
218
- map [string ]any {
219
- "a" : "b" ,
218
+ map [any ]any {
219
+ int8 ( 1 ) : "b" ,
220
220
},
221
221
int8 (1 ),
222
222
}),
0 commit comments