diff options
author | Bourgond Aries <macocio@gmail.com> | 2016-03-27 20:55:49 +0200 |
---|---|---|
committer | Bourgond Aries <macocio@gmail.com> | 2016-03-27 20:55:49 +0200 |
commit | 442f663c2d53e7ad469a3979c04907282a38ac12 (patch) | |
tree | d025a12ef7de7ea54a4d87289776395a4b42b127 /src | |
parent | 770052a9a782efcc896b4dbf9452f73a1b5551ab (diff) | |
download | milf-rs-442f663c2d53e7ad469a3979c04907282a38ac12.tar.gz milf-rs-442f663c2d53e7ad469a3979c04907282a38ac12.zip |
Add advanced lookup for table names
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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(); |