X-Git-Url: http://www.average.org/gitweb/?p=pdns-pipe-nmc.git;a=blobdiff_plain;f=test.hs;h=1f19426c139401552e0b9f066df0f9c1382376dd;hp=8f5b77c330a53812d4a2e7b81f8a847e3faed911;hb=3a7ab2462416bb2e358f267630aa1a4e2acfdd5f;hpb=961eaa01e2d52b53cab104deb4d510d476fb242d diff --git a/test.hs b/test.hs index 8f5b77c..1f19426 100644 --- 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 ("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" + d <- descendNmcDom queryOp [] $ seedNmcDom "root" putStrLn $ show d