Verified Commit 6a1e1eb7 authored by Camil Staps's avatar Camil Staps 🚀

Escape fields in XML export

parent c2cf289a
Pipeline #28200 passed with stage
in 58 seconds
...@@ -11,6 +11,7 @@ import Testing.Options ...@@ -11,6 +11,7 @@ import Testing.Options
import Testing.TestEvents import Testing.TestEvents
import qualified Text import qualified Text
from Text import class Text, instance Text String from Text import class Text, instance Text String
import Text.HTML
import Text.Language import Text.Language
import Testing.Util import Testing.Util
...@@ -117,7 +118,7 @@ where ...@@ -117,7 +118,7 @@ where
printTestSuite :: !JUnitSuite !*File -> *File printTestSuite :: !JUnitSuite !*File -> *File
printTestSuite jus f printTestSuite jus f
# f = f <<< "\t<testsuite name=\"" <<< jus.jus_name # f = f <<< "\t<testsuite name=\"" <<< escapeStr jus.jus_name
<<< "\" tests=\"" <<< jus.jus_tests <<< "\" tests=\"" <<< jus.jus_tests
<<< "\" failures=\"" <<< jus.jus_failures <<< "\" failures=\"" <<< jus.jus_failures
<<< "\" time=\"" <<< time jus.jus_time <<< "\" time=\"" <<< time jus.jus_time
...@@ -127,17 +128,19 @@ where ...@@ -127,17 +128,19 @@ where
= f = f
printProperty :: !(!String,!String) !*File -> *File 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 :: !JUnitCase !*File -> *File
printTestCase juc f printTestCase juc f
# f = f <<< "\t\t<testcase id=\"" <<< juc.juc_id # f = f <<< "\t\t<testcase id=\"" <<< escapeStr juc.juc_id
<<< "\" name=\"" <<< juc.juc_name <<< "\" name=\"" <<< escapeStr juc.juc_name
<<< "\" classname=\"" <<< juc.juc_classname <<< "\" classname=\"" <<< escapeStr juc.juc_classname
<<< "\" time=\"" <<< time juc.juc_time <<< "\" time=\"" <<< time juc.juc_time
<<< "\">" <<< "\">"
# f = case juc.juc_failure of # f = case juc.juc_failure of
Nothing -> f 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 = f <<< "</testcase>\n"
= f = 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