Skip to content

Commit 99afa8d

Browse files
Merge pull request #1200 from r-lib/check-win-devel-stringi-install
Add non-US locale and use pak to upgrade packages in GHA
2 parents d0b47dc + 83de14c commit 99afa8d

File tree

3 files changed

+39
-16
lines changed

3 files changed

+39
-16
lines changed

.github/workflows/check-full.yaml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,44 @@ jobs:
1212
R-CMD-check:
1313
runs-on: ${{ matrix.config.os }}
1414

15-
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
15+
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) ${{ matrix.config.locale }}
1616

1717
strategy:
1818
fail-fast: false
1919
matrix:
2020
config:
21-
- {os: macos-latest, r: 'release'}
21+
- { os: macos-latest, r: "release" }
2222

23-
- {os: windows-latest, r: 'devel'}
24-
- {os: windows-latest, r: 'release'}
23+
- { os: windows-latest, r: "devel" }
24+
- { os: windows-latest, r: "release" }
2525
# use 4.1 to check with rtools40's older compiler
26-
- {os: windows-latest, r: '4.1'}
26+
- { os: windows-latest, r: "4.1" }
2727

28-
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
29-
- {os: ubuntu-latest, r: 'release'}
30-
- {os: ubuntu-latest, r: 'oldrel-1'}
31-
- {os: ubuntu-latest, r: 'oldrel-2'}
32-
- {os: ubuntu-latest, r: 'oldrel-3'}
33-
- {os: ubuntu-latest, r: 'oldrel-4'}
28+
- { os: ubuntu-latest, r: "devel", http-user-agent: "release" }
29+
- { os: ubuntu-latest, r: "devel", locale: "en_US" }
30+
#- { os: ubuntu-latest, r: "release", locale: "zh_CN" }
31+
- { os: ubuntu-latest, r: "oldrel-1" }
32+
- { os: ubuntu-latest, r: "oldrel-2" }
33+
- { os: ubuntu-latest, r: "oldrel-3" }
34+
- { os: ubuntu-latest, r: "oldrel-4" }
3435

3536
env:
3637
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3738
R_KEEP_PKG_SOURCE: yes
3839

3940
steps:
41+
- name: Set 'en_US' locale
42+
if: matrix.config.locale == 'en_US'
43+
run: |
44+
sudo locale-gen en_US
45+
echo "LC_ALL=en_US" >> $GITHUB_ENV
46+
47+
- name: Set 'zh_CN' locale
48+
if: matrix.config.locale == 'zh_CN'
49+
run: |
50+
sudo locale-gen zh_CN
51+
echo "LC_ALL=zh_CN" >> $GITHUB_ENV
52+
4053
- uses: actions/checkout@v4
4154

4255
- uses: r-lib/actions/setup-pandoc@v2
@@ -49,6 +62,8 @@ jobs:
4962

5063
- uses: r-lib/actions/setup-r-dependencies@v2
5164
with:
65+
pak-version: devel
66+
upgrade: "TRUE"
5267
extra-packages: any::rcmdcheck
5368
needs: check
5469

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.Rhistory
44
.Rproj.user
55
.gitsum
6+
.vscode
67
Meta
78
R/scratch
89
README.html

tests/testthat/test-parsing.R

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ test_that("mixed CRLF / LF EOLs fail", {
3636
)
3737
})
3838

39-
test_that("unicode can't be propprely handled on Windows for R < 4.2", {
40-
msg <- ifelse(getRversion() < "4.2" && is_windows(),
41-
"Can't parse input due to unicode restriction in base R\\.",
42-
NA
39+
test_that("unicode can't be properly handled on Windows for R < 4.2", {
40+
skip_if_not(getRversion() < "4.2" && is_windows())
41+
42+
expect_error(
43+
style_text('suit <- "♠"'),
44+
"Can't parse input due to unicode restriction in base R\\."
4345
)
44-
expect_error(style_text('suit <- "♠"'), msg)
46+
})
47+
48+
test_that("unicode is properly handled in all settings other than on Windows for R < 4.2", {
49+
skip_if(getRversion() < "4.2" && is_windows())
50+
51+
expect_error(style_text('suit <- "♠"'), NA)
4552
})

0 commit comments

Comments
 (0)