]> www.average.org Git - pdns-pipe-nmc.git/blobdiff - test.hs
cleanup pdns response generator
[pdns-pipe-nmc.git] / test.hs
diff --git a/test.hs b/test.hs
index 8f5b77c330a53812d4a2e7b81f8a847e3faed911..117994d76e6e706503b81982f0976af42d3d0b80 100644 (file)
--- a/test.hs
+++ b/test.hs
@@ -3,18 +3,20 @@
 module Main where
 
 import Prelude hiding (readFile)
+import System.Environment
 import Data.ByteString.Lazy (ByteString)
-import Data.ByteString.Lazy.Char8 (unpack, readFile)
+import Data.ByteString.Lazy.Char8 (readFile)
 import System.IO.Error
 import Control.Exception
 
 import NmcDom
 
-queryOp :: ByteString -> IO (Either String ByteString)
-queryOp key = catch (readFile ("d/" ++ (unpack key)) >>= return . Right)
+queryOp :: String -> IO (Either String ByteString)
+queryOp key = catch (readFile key >>= return . Right)
                     (\e -> return (Left (show (e :: IOException))))
 
 main = do
-        d <- queryDom queryOp "root"
-        putStrLn $ show d
+        (d:_) <- getArgs
+        descendNmcDom queryOp []               (seedNmcDom d) >>= print
+        descendNmcDom queryOp ["_tcp","_smtp"] (seedNmcDom d) >>= print