--- /dev/null
+use crate::parse_file;
+use color_eyre::Result;
+
+static SOURCE: &str = include_str!("test_source.meta");
+
+#[test]
+fn build_meta_file() -> Result<()> {
+ let source = parse_file(SOURCE)?;
+
+ assert_eq!(source.variables.get("var").unwrap(), &"good");
+ assert_eq!(source.variables.get("blank"), None);
+ assert_eq!(source.variables.get("not_here"), None);
+
+ assert_eq!(
+ source.arrays.get("sub.array").unwrap(),
+ &vec!["sub", "value"]
+ );
+ assert_eq!(
+ source.arrays.get("arr").unwrap(),
+ &vec!["split", "up", "values"]
+ );
+ assert_eq!(
+ source.arrays.get("with_spaces").unwrap(),
+ &vec!["stuff", "with", "spaces"]
+ );
+ assert_eq!(source.arrays.get("not_defined"), None);
+ assert_eq!(source.arrays.get("blank"), None);
+
+ assert_eq!(source.patterns.get("pat").unwrap(), &"pattern");
+ assert_eq!(source.patterns.get("pat.sub_pat"), None);
+ assert_eq!(source.patterns.get("blank_pat"), None);
+ assert_eq!(source.patterns.get("not_defined"), None);
+
+ Ok(())
+}
--- /dev/null
+${
+ var = "good"
+ blank = BLANK
+}
+
+@{
+ sub.array = ["sub","value"]
+ arr = ["split","up","values"]
+ blank = BLANK
+ -{ with_spaces = [ "stuff", "with" , "spaces" ] }
+}
+
+&{
+ pat = "pattern"
+ pat.sub_pat = DEFAULT
+ blank_pat = BLANK
+}
+
+#THIS IS A TEST
+
+with included variables: ${var}
+
+and patterns: &{pat}
+
+and subpatterns: &{pat.sub_pat}
+
+-{ and inline comments }
+and arrays: @{arr} and nested @{sub.array}
+
+and all the other symbols: !@#$%^&*(){}_+