Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of git://github.com/iElectric/augeas_bacula

Conflicts:
	bacula.aug
  • Loading branch information...
commit dfc3fa08bff0414bb4eacdb66fd7c313b130aa01 2 parents 079d3d3 + 9ca1843
@raphink raphink authored
Showing with 47 additions and 1 deletion.
  1. +47 −1 bacula.aug
View
48 bacula.aug
@@ -67,6 +67,8 @@ module Bacula =
. Util.stdexcl
let xfm = transform lns filter
+
+ (* TODO: put tests *)
test (Bacula.line keyvalue) get "Name = kaki-sd\n" =
{"Name" = "kaki-sd"}
@@ -110,6 +112,20 @@ module Bacula =
{ "#comment" = "just a comment"} }
}
+ (* comment as part of directive *)
+ test Bacula.lns get "Storage {\n Name = kaki-sd\n # just a comment\n}" =
+ {"@block" = "Storage"
+ {"Name" = "kaki-sd"
+ }
+ { "#comment" = "just a comment"} }
+
+ (* TODO: comment after } *)
+ test Bacula.lns get "Storage {\n Name = kaki-sd\n}\n # just a comment" =
+ {"@block" = "Storage"
+ {"Name" = "kaki-sd"
+ }
+ { "#comment" = "just a comment"} }
+
(* multiple values *)
test Bacula.lns get "Storage {\n Name = kaki sd\nFoo = moo\n}" =
{"@block" = "Storage"
@@ -172,5 +188,35 @@ module Bacula =
{"File" = "/etc"}
}
}
+ (* no endline *)
+ test Bacula.lns get "Storage {\n Name = kaki sd}" =
+ {"@block" = "Storage"
+ {"Name" = "kaki sd"}
+ }
+
+ (* include statements in directives *)
+ test Bacula.lns get "Storage {\n @/etc/foo.conf\n}\n" =
+ {"Storage"
+ {"@include" = "/etc/foo.conf"}
+ }
+
+ (* TODO: include top level statements *)
+ test Bacula.lns get "@/etc/foo.conf" =
+ {"@include" = "/etc/foo.conf"}
- (* TODO: comment at end of line with } *)
+ (* Blocks can follow each other without \n *)
+ test Bacula.lns get "Storage{Name = kaki sd}Storage{Name = kaki-sd}" =
+ { "@block" = "Storage"
+ { "Name" = "kaki sd" }
+ }
+ { "@block" = "Storage"
+ { "Name" = "kaki-sd" }
+ }
+
+ (* recursive directives *)
+ test Bacula.lns get "FileSet { Include { signature = SHA1 } }" =
+ { "@block" = "FileSet"
+ { "@block" = "Include"
+ { "signature" = "SHA1" }
+ }
+ }
Please sign in to comment.
Something went wrong with that request. Please try again.