]> www.average.org Git - pdns-pipe-nmc.git/blob - test.hs
add another test
[pdns-pipe-nmc.git] / test.hs
1 {-# LANGUAGE OverloadedStrings #-}
2
3 module Main where
4
5 import Prelude hiding (readFile)
6 import System.Environment
7 import Data.ByteString.Lazy (ByteString)
8 import Data.ByteString.Lazy.Char8 (readFile)
9 import System.IO.Error
10 import Control.Exception
11
12 import NmcDom
13
14 queryOp :: String -> IO (Either String ByteString)
15 queryOp key = catch (readFile key >>= return . Right)
16                     (\e -> return (Left (show (e :: IOException))))
17
18 main = do
19         (d:_) <- getArgs
20         descendNmcDom queryOp []               (seedNmcDom d) >>= print
21         descendNmcDom queryOp ["_tcp","_smtp"] (seedNmcDom d) >>= print
22