Skip to content

Test suite issues in version 1.1.5 #159

Description

@tillea

Hi,
I wanted to upgrade the repr package in Debian. Unfortunately there are some admittedly strange issues where diff creates some differences that do not really look like different strings. The test suite output starts with

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test_escaping.r:49'): LaTeX escaping in matrices works ────────────
repr_latex(matrix(c("[", "{", "%", "#"), 2, 2, TRUE)) (`actual`) not identical to "A matrix: 2 × 2 of type chr\n\\begin{tabular}{ll}\n\t {[} & \\{\\\\\n\t \\% &                     \\#\\\\\n\\end{tabular}\n" (`expected`).
    lines(actual)                 | lines(expected)
[1] "A matrix: 2 x 2 of type chr" - "A matrix: 2 × 2 of type chr" [1]
[2] "\\begin{tabular}{ll}"        | "\\begin{tabular}{ll}"        [2]
[3] "\t {[} & \\{\\\\"            | "\t {[} & \\{\\\\"            [3]
[4] "\t \\% & \\#\\\\"            | "\t \\% & \\#\\\\"            [4]
── Failure ('test_escaping.r:56'): LaTeX escaping in matrices works ────────────
repr_latex(...) (`actual`) not identical to "A matrix: 2 × 2 of type chr\n\\begin{tabular}{r|ll}\n  & \\% & \\textbar{}\\\\\n\\hline\n\t\\$ & {]} & \\}\\\\\n\t\\# & \\& &           \\_\\\\\n\\end{tabular}\n" (`expected`).
    lines(actual)                 | lines(expected)
[1] "A matrix: 2 x 2 of type chr" - "A matrix: 2 × 2 of type chr" [1]
[2] "\\begin{tabular}{r|ll}"      | "\\begin{tabular}{r|ll}"      [2]
[3] "  & \\% & \\textbar{}\\\\"   | "  & \\% & \\textbar{}\\\\"   [3]
[4] "\\hline"                     | "\\hline"                     [4]
── Failure ('test_escaping.r:68'): HTML escaping in matrices works ─────────────
repr_html(matrix(c("[", "{", "%", "#"), 2, 2, TRUE)) (`actual`) not identical to "<table class=\"dataframe\">\n<caption>A matrix: 2 × 2 of type chr</caption>\n<tbody>\n\t<tr><td>[</td><td>{</td></tr>\n\t<tr><td>%</td><td>#</td></tr>\n</tbody>\n</table>\n" (`expected`).
lines(actual)[1:5] vs lines(expected)[1:5]
  "<table class=\"dataframe\">"
- "<caption>A matrix: 2 x 2 of type chr</caption>"
+ "<caption>A matrix: 2 × 2 of type chr</caption>"
  "<tbody>"
  "\t<tr><td>[</td><td>{</td></tr>"
  "\t<tr><td>%</td><td>#</td></tr>"

Feel free to find the full build log in the Debian CI.
Kind regards, Andreas.

Activity

  1. aitap commented on Jan 22, 2023

    @aitap

    I don't have a solution, but the "expected" strings contain ×, U+00D7 MULTIPLICATION SIGN, while the "actual" strings contain x, U+0078 LATIN SMALL LETTER X.

  2. tillea commented on Jan 22, 2023

    @tillea
    Author
  3. aitap commented on Jan 22, 2023

    @aitap
  4. tillea commented on Jan 22, 2023

    @tillea
    Author

    We explicitly set LC_ALL=C.UTF-8 for the test . If I set LC_ALL=en_US.UTF-8 the issue becomes at least obvious:

    - "A data.frame: 2 x 6"
    + "A data.frame: 2 \u00d7 6"
    

    I failed with setting LC_ALL=en_US.ISO-8859-1. How is your exact locale setting?
    I'd recommend you'd adapt to UTF-8 which is somehow a widely accepted default.
    Kind regards, Andreas.

  5. aitap commented on Jan 22, 2023

    @aitap
  6. flying-sheep commented on Jan 22, 2023

    @flying-sheep
    Member

    I think what might be happening here is that the package level code here is executed at build time (R packages are compiled to bytecode when building them from source)

    Therefore we might be able to improve things by caching the characters at package initialization instead of on package build time.

    Please check if the debian CI can handle with the version of this package from #160

  7. flying-sheep commented on Jan 22, 2023

    @flying-sheep
    Member

    Please report here if the problem persists, although I don’t think there’s anything that can be done on the repr side

  8. tillea commented on Jan 26, 2023

    @tillea
    Author
  9. flying-sheep commented on Jan 26, 2023

    @flying-sheep
    Member

    I’ll do that once and publish v1.1.6. If you still run into problems there, we’ll have to collaborate in another way, without me pushing speculative fixes, since the CRAN maintainers don’t like frequent updates like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions