]> www.average.org Git - pdns-pipe-nmc.git/blobdiff - test.hs
SRV hack part 2
[pdns-pipe-nmc.git] / test.hs
diff --git a/test.hs b/test.hs
index 7c3be16f36d55dc85299aba23a34d422b07a389f..1f19426c139401552e0b9f066df0f9c1382376dd 100644 (file)
--- a/test.hs
+++ b/test.hs
@@ -4,17 +4,17 @@ module Main where
 
 import Prelude hiding (readFile)
 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 ("data/" ++ (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"
+        d <- descendNmcDom queryOp [] $ seedNmcDom "root"
         putStrLn $ show d