mirror of
https://codeberg.org/icewind/vdf-reader.git
synced 2026-06-03 18:14:07 +02:00
test for broken array
This commit is contained in:
parent
a71c6e73f0
commit
ff98651b2a
3 changed files with 6 additions and 1 deletions
|
|
@ -11,4 +11,5 @@
|
||||||
windows_path "C:\test\no newline"
|
windows_path "C:\test\no newline"
|
||||||
|
|
||||||
\\"$translucent" 1 // this is read vdf written by real valve developers
|
\\"$translucent" 1 // this is read vdf written by real valve developers
|
||||||
|
"$envmaptint" .5 .5 .5 // found in the wild, pretty sure they mean "[.5 .5 .5]", but it ends up working by accident with a stray `.5 = .5` kv
|
||||||
}
|
}
|
||||||
|
|
@ -9,6 +9,8 @@ use vdf_reader::Reader;
|
||||||
fn test_parse(path: &str) {
|
fn test_parse(path: &str) {
|
||||||
let raw = read_to_string(path).unwrap();
|
let raw = read_to_string(path).unwrap();
|
||||||
let mut reader = Reader::from(raw.as_str());
|
let mut reader = Reader::from(raw.as_str());
|
||||||
let parsed = Table::load(&mut reader).expect("failed to parse test data");
|
let parsed = Table::load(&mut reader)
|
||||||
|
.map_err(miette::Error::from)
|
||||||
|
.expect("failed to parse test data");
|
||||||
insta::assert_ron_snapshot!(path, parsed);
|
insta::assert_ron_snapshot!(path, parsed);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ expression: parsed
|
||||||
Table({
|
Table({
|
||||||
"#base": Statement(Statement("panelBase.res")),
|
"#base": Statement(Statement("panelBase.res")),
|
||||||
"Resource/specificPanel.res": Table(Table({
|
"Resource/specificPanel.res": Table(Table({
|
||||||
|
"$envmaptint": Value(Value(".5")),
|
||||||
|
".5": Value(Value(".5")),
|
||||||
"\\\"$translucent\"": Value(Value("1")),
|
"\\\"$translucent\"": Value(Value("1")),
|
||||||
"array": Array(Array([
|
"array": Array(Array([
|
||||||
Value(Value("1")),
|
Value(Value("1")),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue