aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/Test/Graylog/UDP.hs
blob: d62f11a25a0e39b078139181eed040306a6bf2f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{-# LANGUAGE OverloadedStrings #-}

module Test.Graylog.UDP where

import           Test.Tasty
import           Test.Tasty.HUnit

import           Graylog.UDP

tests :: TestTree
tests = testGroup "Test.Graylog.UDP"
   {-[ testCase "Send: Sample" case_validateSomething-}
   [ testCase "Send sample message." case_sendSample
   ]

case_sendSample :: IO ()
case_sendSample = do
   eglog <- openGraylog "192.168.99.100" "12201" defaultChunkSize
   case eglog of
      Left  e -> assertFailure e
      Right g -> sendLog g sample
   where
      sample = simpleGelf "localhost" "hello world!"