tests/testthat/test-read_licor_6800_Excel.R

test_that('Excel Licor files with user remarks are read properly', {
    licor_file <- expect_silent(read_gasex_file(PhotoGEA_example_file_path('c3_aci_1.xlsx')))

    expect_true('user_remarks' %in% names(licor_file))

    expect_equal(
        licor_file$user_remarks$remark_time,
        c('09:22:24', '11:04:20', '13:10:42')
    )

    expect_equal(
        licor_file$user_remarks$remark_value,
        c('Stability Definition: gsw (GasEx): Slp<0.2 Std<0.02 Per=30 A (GasEx): Slp<1 Std<0.2 Per=30', 'a user remark', 'another user remark')
    )
})

test_that('Excel Licor files are not required to have a Remarks sheet', {
    licor_file <- expect_silent(read_gasex_file(PhotoGEA_example_file_path('c3_aci_2.xlsx')))

    expect_true('user_remarks' %in% names(licor_file))

    expect_equal(
        nrow(licor_file$user_remarks),
        0
    )

    expect_true(
        all(is.na(licor_file[, 'user_remark']))
    )
})

Try the PhotoGEA package in your browser

Any scripts or data that you put into this service are public.

PhotoGEA documentation built on April 11, 2025, 5:48 p.m.