Skip to content

Commit

Permalink
Fix test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistuke authored and eborden committed Mar 9, 2019
1 parent 758de88 commit d184b40
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/Network/SocketSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,19 @@ spec = do
let hints = defaultHints { addrFlags = [AI_NUMERICSERV] }
void $ getAddrInfo (Just hints) (Just "localhost") Nothing

#if defined(mingw32_HOST_OS)
let lpdevname = "loopback_0"
#else
let lpdevname = "lo"
#endif

describe "ifNameToIndex" $ do
it "converts a name to an index" $
ifNameToIndex "lo" `shouldReturn` Just 1
ifNameToIndex lpdevname `shouldReturn` Just 1

describe "ifIndexToName" $ do
it "converts an index to a name" $
ifIndexToName 1 `shouldReturn` Just "lo"
ifIndexToName 1 `shouldReturn` Just lpdevname


when isUnixDomainSocketAvailable $ do
Expand Down

0 comments on commit d184b40

Please sign in to comment.