Stefan Saasen avatar Stefan Saasen committed 72ca1b8

Test the isRefAdvertisement function

Comments (0)

Files changed (2)


 , analyseGitOperations
 , RequestDurationStat(..)
 , cloneRequestDuration
+, isRefAdvertisement
 ) where
 import qualified Data.ByteString.Char8 as S


 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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.