Skip to content

Commit

Permalink
Remove win unicode tests
Browse files Browse the repository at this point in the history
To please R CMD check :/
  • Loading branch information
gaborcsardi committed Jun 30, 2023
1 parent a7b9ea9 commit 49432ca
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 254 deletions.
5 changes: 1 addition & 4 deletions src/Makevars.win
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ PKG_CFLAGS = -DSTRICT_R_HEADERS

PKG_LIBS = -lws2_32

all: tools/px.exe tools/pxu.exe tools/sock.exe tools/interrupt.exe \
all: tools/px.exe tools/sock.exe tools/interrupt.exe \
supervisor/supervisor.exe $(SHLIB) client$(SHLIB_EXT)

tools/px.exe: tools/px.c
$(CC) $(CFLAGS) -Wall $< -o $@

tools/pxu.exe: tools/pxu.c
$(CC) $(CFLAGS) -Wall -municode $< -o $@

tools/sock.exe: tools/sock.c
$(CC) $(CFLAGS) -I../inst/include -Wall $< -o $@

Expand Down
2 changes: 1 addition & 1 deletion src/install.libs.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

progs <- if (WINDOWS) {
c(file.path("tools", c("px.exe", "pxu.exe", "interrupt.exe", "sock.exe")),
c(file.path("tools", c("px.exe", "interrupt.exe", "sock.exe")),
file.path("supervisor", "supervisor.exe"))
} else {
c(file.path("tools", c("px", "sock")),
Expand Down
220 changes: 0 additions & 220 deletions src/tools/pxu.c

This file was deleted.

29 changes: 0 additions & 29 deletions tests/testthat/test-utf8.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ test_that("UTF-8 directory name", {
expect_equal(out$status, 10)
})

test_that("UTF-8 argument", {
skip_other_platforms("windows")
local_temp_dir()
unc <- "\u00fa\u00e1\u00f6\u0151\u00e9\u0414\u041e\u0411\u0420\u041e"
out <- run(get_tool("pxu"), c("writefile", "of", unc))
outarg <- readBin("of", what = "raw", n = 200)
exp <- iconv(unc, from = "UTF-8", to = "UTF-16LE", toRaw = TRUE)[[1]]
expect_equal(exp, outarg)
})

test_that("native program name is converted to UTF-8", {
skip_other_platforms("windows")
if (!l10n_info()$`Latin-1`) skip("Needs latin1 locale")
Expand All @@ -60,25 +50,6 @@ test_that("native program name is converted to UTF-8", {
expect_equal(out$status, 10)
})

test_that("native args are converted to UTF-8", {
skip_other_platforms("windows")
if (!l10n_info()$`Latin-1`) skip("Needs latin1 locale")
local_temp_dir()
name <- enc2native("\u00fa\u00e1\u00f6")

out <- run(get_tool("px"), c("writefile", "of", name))
expect_equal(
charToRaw(name),
readBin("of", what = "raw", n = 100)
)

out2 <- run(get_tool("pxu"), c("writefile", "of2", name))
expect_equal(
iconv(name, to = "UTF-16LE", toRaw = TRUE)[[1]],
readBin("of2", what = "raw", n = 100)
)
})

# TODO: more UTF-8 output

test_that("UTF-8 in stdout", {
Expand Down

0 comments on commit 49432ca

Please sign in to comment.