statements

This commit is contained in:
Robin Appelman 2023-12-15 16:22:51 +01:00
commit 12d3e35496
8 changed files with 69 additions and 53 deletions

12
tests/data/messy.vdf Normal file
View 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"
}

View file

@ -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());

View 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")),
})),
})