| 1 |
|
| 2 |
test_that("/etc/os-release files can be parsed", { |
| 3 |
|
| 4 |
contents <- ' |
| 5 |
# This is a comment. |
| 6 |
|
| 7 |
NAME="Ubuntu" |
| 8 |
VERSION="18.04.5 LTS (Bionic Beaver)" |
| 9 |
ID=ubuntu |
| 10 |
ID_LIKE=debian |
| 11 |
PRETTY_NAME="Ubuntu 18.04.5 LTS" |
| 12 |
VERSION_ID="18.04" |
| 13 |
HOME_URL="https://www.ubuntu.com/" |
| 14 |
SUPPORT_URL="https://help.ubuntu.com/" |
| 15 |
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" |
| 16 |
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" |
| 17 |
VERSION_CODENAME=bionic |
| 18 |
UBUNTU_CODENAME=bionic |
| 19 |
' |
| 20 |
|
| 21 |
file <- renv_scope_tempfile("os-release-") |
| 22 |
writeLines(contents, con = file) |
| 23 |
|
| 24 |
sysinfo <- list(sysname = "linux") |
| 25 |
prefix <- renv_bootstrap_platform_os_via_os_release(file, sysinfo) |
| 26 |
expect_equal(prefix, "linux-ubuntu-bionic") |
| 27 |
|
| 28 |
}) |