Verified Commit 442696cc authored by Camil Staps's avatar Camil Staps 🚀

Escape fields in XML export

parent 13a99852
Pipeline #28199 passed with stage
in 56 seconds
......@@ -11,6 +11,7 @@ import Testing.Options
import Testing.TestEvents
import qualified Text
from Text import class Text, instance Text String
import Text.HTML
import Text.Language
import Testing.Util
......@@ -117,7 +118,7 @@ where
printTestSuite :: !JUnitSuite !*File -> *File
printTestSuite jus f
# f = f <<< "\t<testsuite name=\"" <<< jus.jus_name
# f = f <<< "\t<testsuite name=\"" <<< escapeStr jus.jus_name
<<< "\" tests=\"" <<< jus.jus_tests
<<< "\" failures=\"" <<< jus.jus_failures
<<< "\" time=\"" <<< time jus.jus_time
......@@ -127,17 +128,19 @@ where
= f
printProperty :: !(!String,!String) !*File -> *File
printProperty (key,val) f = f <<< "\t\t\t<property name=\"" <<< key <<< "\" value=\"" <<< val <<< "\"?>\n"
printProperty (key,val) f = f <<< "\t\t\t<property name=\"" <<< escapeStr key
<<< "\" value=\"" <<< escapeStr val
<<< "\"?>\n"
printTestCase :: !JUnitCase !*File -> *File
printTestCase juc f
# f = f <<< "\t\t<testcase id=\"" <<< juc.juc_id
<<< "\" name=\"" <<< juc.juc_name
<<< "\" classname=\"" <<< juc.juc_classname
# f = f <<< "\t\t<testcase id=\"" <<< escapeStr juc.juc_id
<<< "\" name=\"" <<< escapeStr juc.juc_name
<<< "\" classname=\"" <<< escapeStr juc.juc_classname
<<< "\" time=\"" <<< time juc.juc_time
<<< "\">"
# f = case juc.juc_failure of
Nothing -> f
Just r -> f <<< "\n\t\t\t<failure>" <<< r <<< "</failure>\n\t\t"
Just r -> f <<< "\n\t\t\t<failure>" <<< escapeStr r <<< "</failure>\n\t\t"
# f = f <<< "</testcase>\n"
= f
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment