some test cases from the field
authorEugene Crosser <crosser@average.org>
Mon, 14 Apr 2014 06:04:44 +0000 (10:04 +0400)
committerEugene Crosser <crosser@average.org>
Mon, 14 Apr 2014 06:04:44 +0000 (10:04 +0400)
d/ddomob [new file with mode: 0644]
d/dnameid [new file with mode: 0644]
d/domob [new file with mode: 0644]
d/nameid [new file with mode: 0644]
test.hs

diff --git a/d/ddomob b/d/ddomob
new file mode 100644 (file)
index 0000000..09ed737
--- /dev/null
+++ b/d/ddomob
@@ -0,0 +1 @@
+{"ip":"37.187.243.109","map":{"*":"37.187.243.109"},"fingerprint":["F3ABCF9B979CAAADD6E3B5E7674A886A25F3F0BB"],"tor":"wivfwn64tm3uaeig.onion"}
diff --git a/d/dnameid b/d/dnameid
new file mode 100644 (file)
index 0000000..10b95b3
--- /dev/null
+++ b/d/dnameid
@@ -0,0 +1 @@
+{"import":"d/ddomob","tor":"yspwdthzg3tnmpzn.onion"}
diff --git a/d/domob b/d/domob
new file mode 100644 (file)
index 0000000..bb8c940
--- /dev/null
+++ b/d/domob
@@ -0,0 +1 @@
+{"import":"d/ddomob"}
diff --git a/d/nameid b/d/nameid
new file mode 100644 (file)
index 0000000..3d042b6
--- /dev/null
+++ b/d/nameid
@@ -0,0 +1 @@
+{"import":"d/dnameid"}
diff --git a/test.hs b/test.hs
index 3bcd4bc12187fffcbe08faff6f915540d50ebb46..117994d76e6e706503b81982f0976af42d3d0b80 100644 (file)
--- a/test.hs
+++ b/test.hs
@@ -3,6 +3,7 @@
 module Main where
 
 import Prelude hiding (readFile)
+import System.Environment
 import Data.ByteString.Lazy (ByteString)
 import Data.ByteString.Lazy.Char8 (readFile)
 import System.IO.Error
@@ -15,6 +16,7 @@ queryOp key = catch (readFile key >>= return . Right)
                     (\e -> return (Left (show (e :: IOException))))
 
 main = do
-        descendNmcDom queryOp []               (seedNmcDom "root") >>= print
-        descendNmcDom queryOp ["_tcp","_smtp"] (seedNmcDom "root") >>= print
+        (d:_) <- getArgs
+        descendNmcDom queryOp []               (seedNmcDom d) >>= print
+        descendNmcDom queryOp ["_tcp","_smtp"] (seedNmcDom d) >>= print