Compare commits

..

2 Commits

Author SHA1 Message Date
Nikita Vorontsov 64a710d53d
Merge 10e3e381ed into 63dd116924 2025-07-14 07:21:09 +00:00
Nikita Vorontsov 10e3e381ed add vmap tests 2025-07-14 10:20:15 +03:00
1 changed files with 24 additions and 0 deletions

View File

@ -240,6 +240,30 @@ func TestMarshalSet(t *testing.T) {
Timeout: 30 * time.Second,
},
},
{
name: "Map ip-ip", // generic case
set: Set{
Name: "test-map",
ID: uint32(3),
Table: tbl,
KeyType: TypeIPAddr,
DataType: TypeIPAddr,
IsMap: true,
},
},
{
// special case, see
// sets.go:setsFromMsg:(case unix.NFTA_SET_DATA_TYPE) and sets.go:AddSet:(if s.DataType.nftMagic == 1)
name: "Vedict map",
set: Set{
Name: "test-map",
ID: uint32(3),
Table: tbl,
KeyType: TypeIPAddr,
DataType: TypeVerdict,
IsMap: true,
},
},
}
for i, tt := range tests {