tests/testthat/test-compare_lines.R

context("compare_lines")

test_that("compare all", {

  testthat::expect_silent(
    beautier:::compare_lines(
      lines = readLines(beautier::get_beautier_path("bd_2_4.xml")),
      expected = readLines(beautier::get_beautier_path("bd_2_4.xml")),
      section = NA,
      created_lines_filename = tempfile(),
      expected_lines_filename = tempfile()
    )
  )
})

test_that("compare state", {

  testthat::expect_silent(
    beautier:::compare_lines(
      lines = readLines(beautier::get_beautier_path("bd_2_4.xml")),
      expected = readLines(beautier::get_beautier_path("bd_2_4.xml")),
      section = "state",
      created_lines_filename = tempfile(),
      expected_lines_filename = tempfile()
    )
  )
})

test_that("compare operators", {

  testthat::expect_silent(
    beautier:::compare_lines(
      lines = readLines(beautier::get_beautier_path("bd_2_4.xml")),
      expected = readLines(beautier::get_beautier_path("bd_2_4.xml")),
      section = "operators",
      created_lines_filename = tempfile(),
      expected_lines_filename = tempfile()
    )
  )
})
ropensci/beautier documentation built on March 12, 2019, 8:27 p.m.