Skip to content

Commit 9b608c5

Browse files
authored
Merge branch 'main' into feature/add-recursive-dirs
2 parents dde1741 + 5550c98 commit 9b608c5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
* `test_dir()` gains a `recursive` argument which allows test files in nested directories (#1605).
44

5+
* `JunitReporter()` now uses ensures numeric values are saved the xml file
6+
with `.` as decimal separator. (@maksymiuks, #1660)
7+
58
# testthat 3.2.0
69

710
## Lifecycle changes

R/reporter-junit.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ JunitReporter <- R6::R6Class("JunitReporter",
8585
},
8686

8787
end_context = function(context) {
88+
# Always uses . as decimal place in output regardless of options set in test
89+
withr::local_options(list(OutDec = "."))
8890
xml2::xml_attr(self$suite, "tests") <- as.character(self$tests)
8991
xml2::xml_attr(self$suite, "skipped") <- as.character(self$skipped)
9092
xml2::xml_attr(self$suite, "failures") <- as.character(self$failures)
@@ -96,6 +98,7 @@ JunitReporter <- R6::R6Class("JunitReporter",
9698
},
9799

98100
add_result = function(context, test, result) {
101+
withr::local_options(list(OutDec = "."))
99102
self$tests <- self$tests + 1
100103

101104
time <- self$elapsed_time()

0 commit comments

Comments
 (0)