From 442f663c2d53e7ad469a3979c04907282a38ac12 Mon Sep 17 00:00:00 2001 From: Bourgond Aries Date: Sun, 27 Mar 2016 20:55:49 +0200 Subject: Add advanced lookup for table names --- src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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(); -- cgit v1.2.3