mirror of
https://codeberg.org/icewind/vdf-reader.git
synced 2026-06-03 10:04:08 +02:00
add support for deserializing a map with int keys as a sequence
This commit is contained in:
parent
1a37f7e866
commit
b928f85df6
14 changed files with 226 additions and 9 deletions
11
tests/snapshots/serde__table__tests__data__maparray.vdf.snap
Normal file
11
tests/snapshots/serde__table__tests__data__maparray.vdf.snap
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
source: tests/serde.rs
|
||||
expression: result
|
||||
---
|
||||
{
|
||||
"MapArray": {
|
||||
"0": "foo",
|
||||
"1": "bar",
|
||||
"2": "asd",
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
source: tests/serde.rs
|
||||
expression: material
|
||||
---
|
||||
MapArray([
|
||||
"foo",
|
||||
"bar",
|
||||
"asd",
|
||||
])
|
||||
9
tests/snapshots/serde__tests__data__maparray.vdf.snap
Normal file
9
tests/snapshots/serde__tests__data__maparray.vdf.snap
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
source: tests/serde.rs
|
||||
expression: result
|
||||
---
|
||||
MapArray([
|
||||
"foo",
|
||||
"bar",
|
||||
"asd",
|
||||
])
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
source: tests/serde.rs
|
||||
expression: out
|
||||
---
|
||||
vmt_reader::unexpected_token
|
||||
|
||||
× Invalid array key 3, expected 2
|
||||
╭─[5:3]
|
||||
4 │ "1" "bar"
|
||||
5 │ "3" "asd"
|
||||
· ─┬─
|
||||
· ╰── Invalid array key 3, expected 2
|
||||
6 │ }
|
||||
╰────
|
||||
|
|
@ -4,11 +4,10 @@ expression: out
|
|||
---
|
||||
vmt_parser::unknown_variant
|
||||
|
||||
× Unknown variant "Resource" expected on of expected on of Types, LightmappedGeneric, Resource/specificPanel.res, UserConfigData, Sprite, EnumInMap
|
||||
× Unknown variant "Resource" expected on of expected on of Types, LightmappedGeneric, Resource/specificPanel.res, UserConfigData, Sprite, EnumInMap, MapArray
|
||||
╭─[1:1]
|
||||
1 │ "Resource"
|
||||
· ─────┬────
|
||||
· ╰── expected on of Types, LightmappedGeneric, Resource/specificPanel.res, UserConfigData, Sprite, EnumInMap
|
||||
· ╰── expected on of Types, LightmappedGeneric, Resource/specificPanel.res, UserConfigData, Sprite, EnumInMap, MapArray
|
||||
2 │ {
|
||||
╰────
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue