Public bug reported:

The relevant part of the log is:

```
527s ══ Failed tests 
════════════════════════════════════════════════════════════════
527s ── Failure ('test-xml_parse.R:54:3'): read_html properly passes parser 
arguments ──
527s as_list(blanks)$html$body$catalog$cd[[1]] (`actual`) not equal to "\r\n    
" (`expected`).
527s 
527s `lines(actual)`:   ""   "    "
527s `lines(expected)`: "\r" "    "
527s 
527s [ FAIL 1 | WARN 0 | SKIP 21 | PASS 372 ]
527s Error: Test failures
527s Execution halted
527s autopkgtest [12:35:09]: test run-unit-test: -----------------------]
528s run-unit-test        FAIL non-zero exit status 1
```

The test is:

```
test_that("read_html properly passes parser arguments", {
  skip_if_not(libxml2_version() >= "2.9.2")

  blanks <- read_html(xml2_example("cd_catalog.xml"), options = c("RECOVER", 
"NOERROR"))
  expect_equal(
    as_list(blanks)$html$body$catalog$cd[[1]],
    "\r\n    "
  )

  no_blanks <- read_html(xml2_example("cd_catalog.xml"), options =
c("RECOVER", "NOERROR", "NOBLANKS"))

  expect_equal(
    as_list(no_blanks)$html$body$catalog$cd[[1]],
    list("Empire Burlesque")
  )
})
```

The most probable reason is that libxml2 normalizes line endings
according to XML standards, converting \r\n to \n. The fix would be to
correct the expected value to \n.

** Affects: r-cran-xml2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2116822

Title:
  Failing unit test due to whitespace handling mismatch

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/r-cran-xml2/+bug/2116822/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to