X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=test_augeas.ml;h=1be88b7e9331a4ab9434a5c2e67f388fa00e1273;hb=1166d4e54bd5358f6449ec937ba50432d5d9c608;hp=0124b589e5ed572bd60e6374137eb514b13d413c;hpb=d92842594f602cc60b199b7377862a10798dbb7a;p=ocaml-augeas.git diff --git a/test_augeas.ml b/test_augeas.ml index 0124b58..1be88b7 100644 --- a/test_augeas.ml +++ b/test_augeas.ml @@ -20,18 +20,17 @@ let () = let aug = - let loadpath = Some "/usr/share/augeas/lenses" in + let loadpath = None in let flags = [ Augeas.AugSaveBackup ] in Augeas.create "test_root" loadpath flags in - (* Print all files. *) - let files = Augeas.matches aug "/files/*" in - List.iter print_endline files; - - (* Print all Augeas-metainfo. *) - let augs = Augeas.matches aug "/augeas/*" in - List.iter print_endline augs; - + (* Print all files recursively. *) + let rec print path = + if path <> "" then print_endline path; + let files = List.sort compare (Augeas.matches aug (path ^ "/*")) in + List.iter print files + in + print ""; (* Run the garbage collector to check for internal errors. *) Gc.compact ()