Skip to content

Commit

Permalink
Add R code creating the files
Browse files Browse the repository at this point in the history
  • Loading branch information
trossi committed Sep 13, 2024
1 parent 833db9a commit 2d8c1f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rdata/tests/test_rdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,15 @@ def test_ascii(self) -> None:

def test_ascii_characters(self) -> None:
"""Test reading string with all ascii printable characters."""
# File created in R with
# saveRDS("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\v\f\r\n", file="test_ascii_chars.rds") # noqa: E501,ERA001
data = rdata.read_rds(TESTDATA_PATH / "test_ascii_chars.rds")
assert data == "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\v\f\r\n", data # noqa: E501

def test_ascii_ascii_characters(self) -> None:
"""Test reading string with all ascii printable characters."""
# File created in R with
# saveRDS("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\v\f\r\n", file="test_ascii_ascii_chars.rds", ascii=TRUE, compress=FALSE) # noqa: E501,ERA001
data = rdata.read_rds(TESTDATA_PATH / "test_ascii_ascii_chars.rds")
assert data == "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\v\f\r\n", data # noqa: E501

Expand Down

0 comments on commit 2d8c1f4

Please sign in to comment.