diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml index b9c209f8b..d36be307c 100644 --- a/.github/workflows/check-full.yaml +++ b/.github/workflows/check-full.yaml @@ -12,31 +12,44 @@ jobs: R-CMD-check: runs-on: ${{ matrix.config.os }} - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) ${{ matrix.config.locale }} strategy: fail-fast: false matrix: config: - - {os: macos-latest, r: 'release'} + - { os: macos-latest, r: "release" } - - {os: windows-latest, r: 'devel'} - - {os: windows-latest, r: 'release'} + - { os: windows-latest, r: "devel" } + - { os: windows-latest, r: "release" } # use 4.1 to check with rtools40's older compiler - - {os: windows-latest, r: '4.1'} + - { os: windows-latest, r: "4.1" } - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - - {os: ubuntu-latest, r: 'oldrel-2'} - - {os: ubuntu-latest, r: 'oldrel-3'} - - {os: ubuntu-latest, r: 'oldrel-4'} + - { os: ubuntu-latest, r: "devel", http-user-agent: "release" } + - { os: ubuntu-latest, r: "devel", locale: "en_US" } + #- { os: ubuntu-latest, r: "release", locale: "zh_CN" } + - { os: ubuntu-latest, r: "oldrel-1" } + - { os: ubuntu-latest, r: "oldrel-2" } + - { os: ubuntu-latest, r: "oldrel-3" } + - { os: ubuntu-latest, r: "oldrel-4" } env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: + - name: Set 'en_US' locale + if: matrix.config.locale == 'en_US' + run: | + sudo locale-gen en_US + echo "LC_ALL=en_US" >> $GITHUB_ENV + + - name: Set 'zh_CN' locale + if: matrix.config.locale == 'zh_CN' + run: | + sudo locale-gen zh_CN + echo "LC_ALL=zh_CN" >> $GITHUB_ENV + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -49,6 +62,8 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: + pak-version: devel + upgrade: "TRUE" extra-packages: any::rcmdcheck needs: check diff --git a/.gitignore b/.gitignore index e0d2606ed..b9b86f2c7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .Rhistory .Rproj.user .gitsum +.vscode Meta R/scratch README.html diff --git a/tests/testthat/test-parsing.R b/tests/testthat/test-parsing.R index 18876da8e..6f37f806e 100644 --- a/tests/testthat/test-parsing.R +++ b/tests/testthat/test-parsing.R @@ -36,10 +36,17 @@ test_that("mixed CRLF / LF EOLs fail", { ) }) -test_that("unicode can't be propprely handled on Windows for R < 4.2", { - msg <- ifelse(getRversion() < "4.2" && is_windows(), - "Can't parse input due to unicode restriction in base R\\.", - NA +test_that("unicode can't be properly handled on Windows for R < 4.2", { + skip_if_not(getRversion() < "4.2" && is_windows()) + + expect_error( + style_text('suit <- "♠"'), + "Can't parse input due to unicode restriction in base R\\." ) - expect_error(style_text('suit <- "♠"'), msg) +}) + +test_that("unicode is properly handled in all settings other than on Windows for R < 4.2", { + skip_if(getRversion() < "4.2" && is_windows()) + + expect_error(style_text('suit <- "♠"'), NA) })