[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Any idea why autopkgtest of r-cran-repr fails (seems broken string comparison issue)



The error being shown isn't line endings but different characters for
multiplication - letter 'x' vs multiplication sign 'U+00D7'.

However, I don't see this failure running the autopkgtest locally with
your latest commit below - maybe something about your locale leaking
into the test?

GOrdon

On Sun, Jan 24, 2021 at 10:02:53PM +0100, Andreas Tille wrote:
> Hi,
> 
> I updated r-cran-repr and assumed I would have fixed the autopkgtest by
> using UTF-8[1].  Now the test output is:
> 
> 
> ── Failure (test_repr_array_df.r:18:2): factors display correctly ──────────────
> repr_html(df) (`actual`) not identical to "<table class=\"dataframe\">\n<caption>A data.frame: 1 × 1</caption>\n<thead>\n\t<tr><th scope=col>a</th></tr>\n\t<tr><th scope=col>&lt;fct&gt;</th></tr>\n</thead>\n<tbody>\n\t<tr><td>iamafactor</td></tr>\n</tbody>\n</table>\n" (`expected`).
> 
> lines(actual[[1]])[1:5] vs lines(expected[[1]])[1:5]
>   "<table class=\"dataframe\">"
> - "<caption>A data.frame: 1 x 1</caption>"
> + "<caption>A data.frame: 1 × 1</caption>"
>   "<thead>"
>   "\t<tr><th scope=col>a</th></tr>"
>   "\t<tr><th scope=col>&lt;fct&gt;</th></tr>"
> ── Failure (test_repr_array_df.r:35:2): mixed factors and strings display correctly ──
> repr_html(df) (`actual`) not identical to "<table class=\"dataframe\">\n<caption>A data.frame: 1 × 2</caption>\n<thead>\n\t<tr><th scope=col>a</th><th scope=col>b</th></tr>\n\t<tr><th scope=col>&lt;chr&gt;</th><th scope=col>&lt;fct&gt;</th></tr>\n</thead>\n<tbody>\n\t<tr><td>iamastring</td><td>iamafactor</td></tr>\n</tbody>\n</table>\n" (`expected`).
> 
> lines(actual[[1]])[1:5] vs lines(expected[[1]])[1:5]
>   "<table class=\"dataframe\">"
> - "<caption>A data.frame: 1 x 2</caption>"
> + "<caption>A data.frame: 1 × 2</caption>"
>   "<thead>"
>   "\t<tr><th scope=col>a</th><th scope=col>b</th></tr>"
>   "\t<tr><th scope=col>&lt;chr&gt;</th><th scope=col>&lt;fct&gt;</th></tr>"
> ── Failure (test_repr_array_df.r:51:2): date display correctly ─────────────────
> repr_html(df) (`actual`) not identical to "<table class=\"dataframe\">\n<caption>A data.frame: 1 × 1</caption>\n<thead>\n\t<tr><th scope=col>a</th></tr>\n\t<tr><th scope=col>&lt;dttm&gt;</th></tr>\n</thead>\n<tbody>\n\t<tr><td>2016-05-28 10:00:00</td></tr>\n</tbody>\n</table>\n" (`expected`).
> 
> lines(actual[[1]])[1:5] vs lines(expected[[1]])[1:5]
>   "<table class=\"dataframe\">"
> - "<caption>A data.frame: 1 x 1</caption>"
> + "<caption>A data.frame: 1 × 1</caption>"
>   "<thead>"
>   "\t<tr><th scope=col>a</th></tr>"
>   "\t<tr><th scope=col>&lt;dttm&gt;</th></tr>"
> ── Failure (test_repr_array_df.r:67:2): markdown works ─────────────────────────
> repr_markdown(df) (`actual`) not identical to "\nA data.frame: 2 × 2\n\n| a &lt;int&gt; | b &lt;chr&gt; |\n|---|---|\n| 1 | a |\n| 2 | b |\n\n" (`expected`).
> 
> 
> I wonder whether this might be some issue of different line ending
> encodings or whatever, which makes the obviously equal strings different
> in this test.  Any idea how to fix this?
> 
> Kind regards
> 
>       Andreas.
> 
> 
> [1] https://salsa.debian.org/r-pkg-team/r-cran-repr/-/commit/ef7475a798d72b388e6bb092de06ff49f58e1504
> 
> -- 
> http://fam-tille.de
> 


Reply to: