Skip to content

Commit

Permalink
XmlEncode failure message in JUnitReporter (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick authored and lefthandedgoat committed May 21, 2017
1 parent bdc02a6 commit 8525388
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/canopy/reporters.fs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,9 @@ type JUnitReporter(resultFilePath:string) =
|> Seq.map(fun id -> sprintf "<testcase name=\"%s\" time=\"%.3f\"/>" id (getTestTime id))
let failedTestsXml =
failedTests
|> Seq.map(fun (ex, id) -> sprintf "<testcase name=\"%s\" time=\"%.3f\"><failure>%s</failure></testcase>" id (getTestTime id) ex.Message)
|> Seq.map(fun (ex, id) ->
Security.SecurityElement.Escape ex.Message
|> sprintf "<testcase name=\"%s\" time=\"%.3f\"><failure>%s</failure></testcase>" id (getTestTime id))
let testCount = passed + failed
let testTimeSum = testTimes |> Seq.sumBy snd
let allTestsXml = String.Join(String.Empty, Seq.concat [passedTestsXml; failedTestsXml])
Expand Down

0 comments on commit 8525388

Please sign in to comment.