1. Stefan Saasen
  2. stash-log-parser


Stefan Saasen  committed 72ca1b8

Test the isRefAdvertisement function

Comments (0)

Files changed (2)

File logparser/src/Stash/Log/GitOpsAnalyser.hs Modified

View file
  • Ignore whitespace
  • Hide word diff
 , analyseGitOperations
 , RequestDurationStat(..)
 , cloneRequestDuration
+, isRefAdvertisement
 ) where
 import qualified Data.ByteString.Char8 as S

File logparser/tests/Properties.hs Modified

View file
  • Ignore whitespace
  • Hide word diff
 import qualified Test.HUnit as H
 import Stash.Log.Analyser
 import Stash.Log.Parser
+import Stash.Log.GitOpsAnalyser
 import Data.Maybe
 import Test.QuickCheck hiding ((.&.))
 import Test.Framework (Test, defaultMain, testGroup)
     (getPath $ getAction $ fromJust parsedLogLine3)
+test_classifyRefAdv = H.assertBool
+    "Should identify ref advertisement"
+    (isRefAdvertisement $ fromJust parsedLogLine)
 test_logLineParseDetails = H.assertEqual
     "Should parse the labels correctly"
     "\"\" \"git/\""
       testGroup "parser"
       [ testCase "parser/parse empty String" test_logLineParserEmpty
         ,testCase "parser/parse single line" test_logLineParseSingleLine
+        ,testCase "parser/parse classify log line" test_classifyRefAdv
         ,testCase "parser/parse protocol (https)" test_logLineParseProtocol
         ,testCase "parser/parse protocol (ssh)" test_logLineParseProtocolSsh
         ,testCase "parser/parse request id" test_logLineParseRequestId