Add advanced lookup for table names
This commit is contained in:
parent
770052a9a7
commit
442f663c2d
|
@ -445,6 +445,13 @@ mod tests {
|
||||||
assert_eq!(*looked, Value::Integer(0));
|
assert_eq!(*looked, Value::Integer(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn lookup_advanced_table() {
|
||||||
|
let value: Value = r#"[table."name.other"] value = "my value""#.parse().unwrap();
|
||||||
|
let looked = value.lookup(r#"table."name.other".value"#).unwrap();
|
||||||
|
assert_eq!(*looked, Value::String(String::from("my value")));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn lookup_mut_advanced() {
|
fn lookup_mut_advanced() {
|
||||||
let mut value: Value = "[table]\n\"value\" = [0, 1, 2]".parse().unwrap();
|
let mut value: Value = "[table]\n\"value\" = [0, 1, 2]".parse().unwrap();
|
||||||
|
|
Loading…
Reference in a new issue