aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBourgond Aries <macocio@gmail.com>2016-03-27 20:55:49 +0200
committerBourgond Aries <macocio@gmail.com>2016-03-27 20:55:49 +0200
commit442f663c2d53e7ad469a3979c04907282a38ac12 (patch)
treed025a12ef7de7ea54a4d87289776395a4b42b127
parent770052a9a782efcc896b4dbf9452f73a1b5551ab (diff)
downloadmilf-rs-442f663c2d53e7ad469a3979c04907282a38ac12.tar.gz
milf-rs-442f663c2d53e7ad469a3979c04907282a38ac12.zip
Add advanced lookup for table names
-rw-r--r--src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 88d8072..9af0c70 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -445,6 +445,13 @@ mod tests {
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]
fn lookup_mut_advanced() {
let mut value: Value = "[table]\n\"value\" = [0, 1, 2]".parse().unwrap();