Skip to content

Update locale in test.data.table#4630

Merged
mattdowle merged 3 commits intomasterfrom
fix_locale
Aug 4, 2020
Merged

Update locale in test.data.table#4630
mattdowle merged 3 commits intomasterfrom
fix_locale

Conversation

@ColeMiller1
Copy link
Copy Markdown
Contributor

On Windows, the locale would not get reset after the test.data.table() was complete. For me, that meant that the first test would be successful but then I had these weird UTC errors.

The issue was caused by on.exit() being used in a for loop for a test. It turns out when you use a variable assigned in a for loop within on.exit(), the last instance of the variable is used on exit. Follow-up to #4524 .

double_on_exit = function() {
    for (i in 1:2) {
        lc = letters[i]
        on.exit(print(lc), add = TRUE)
    }
    on.exit(print('bye'), add = TRUE)
}
double_on_exit()
#> [1] "b"
#> [1] "b"
#> [1] "bye"

@mattdowle mattdowle added this to the 1.13.1 milestone Aug 4, 2020
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 4, 2020

Codecov Report

Merging #4630 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4630   +/-   ##
=======================================
  Coverage   99.61%   99.61%           
=======================================
  Files          73       73           
  Lines       14244    14244           
=======================================
  Hits        14189    14189           
  Misses         55       55           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0942ad...6693319. Read the comment docs.

@mattdowle mattdowle merged commit dfd91ca into master Aug 4, 2020
@mattdowle mattdowle deleted the fix_locale branch August 4, 2020 01:27
hongyuanjia pushed a commit to hongyuanjia/data.table that referenced this pull request Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants