mirror of
https://codeberg.org/icewind/vdf-reader.git
synced 2026-06-03 10:04:08 +02:00
statements
This commit is contained in:
parent
8e3f20a298
commit
12d3e35496
8 changed files with 69 additions and 53 deletions
12
tests/data/messy.vdf
Normal file
12
tests/data/messy.vdf
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
"#base" "panelBase.res"
|
||||
|
||||
"Resource/specificPanel.res"
|
||||
{
|
||||
// Specify panel-specific controls here
|
||||
empty ""
|
||||
"empty quoted" "\"\""
|
||||
array 1
|
||||
array 2
|
||||
array "3"
|
||||
windows_path "C:\test\no newline"
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ use vdf_reader::entry::Table;
|
|||
use vdf_reader::Reader;
|
||||
|
||||
#[test_case("tests/data/concrete.vmt")]
|
||||
#[test_case("tests/data/messy.vdf")]
|
||||
fn test_parse(path: &str) {
|
||||
let raw = read_to_string(path).unwrap();
|
||||
let mut reader = Reader::from(raw.as_str());
|
||||
|
|
|
|||
17
tests/snapshots/parse__parse-2.snap
Normal file
17
tests/snapshots/parse__parse-2.snap
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
source: tests/parse.rs
|
||||
expression: parsed
|
||||
---
|
||||
Table({
|
||||
"#base": Statement(Statement("panelBase.res")),
|
||||
"Resource/specificPanel.res": Table(Table({
|
||||
"array": Array(Array([
|
||||
Value(Value("1")),
|
||||
Value(Value("2")),
|
||||
Value(Value("3")),
|
||||
])),
|
||||
"empty": Value(Value("")),
|
||||
"empty quoted": Value(Value("\"\"")),
|
||||
"windows_path": Value(Value("C:\\test\\no newline")),
|
||||
})),
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue