]> gitweb.michael.orlitzky.com - haeredes.git/blobdiff - src/Main.hs
Sort output to fix random breakage in the test suite.
[haeredes.git] / src / Main.hs
index c93697a0c7d565e431201a56c7d851e10d1f4f2e..c9356bfd9318de6d96c279d0bd9dd0608fe9b332 100644 (file)
@@ -9,7 +9,7 @@ import qualified Data.ByteString.Char8 as BS (
   getContents,
   pack,
   words )
-import Data.List ( (\\), intersperse )
+import Data.List ( (\\), intersperse, sort )
 import Network.DNS (
   DNSError(NameError),
   Domain,
@@ -69,7 +69,8 @@ report _ _ (_, Left _) = return ()
 -- report the leftovers.
 report delgts normalize_function (d, Right raw_hosts) = do
   let nrml_hosts = map normalize_function raw_hosts
-  let leftovers = nrml_hosts \\ delgts
+  -- Sort the leftovers so that we can test the expected output.
+  let leftovers = sort (nrml_hosts \\ delgts)
   unless (null leftovers) $
     putStrLn $ "Domain " ++
                (show d) ++