tests/testthat/test-insertion_comment_interaction.R

##  ............................................................................
##  strict = TRUE                                                           ####

test_that("token are added correctly to conditional statements", {
  expect_warning(test_collection(
    "insertion_comment_interaction", "just_if_strict",
    transformer = style_text
  ), NA)
})

test_that("token are added correctly to conditional statements", {
  expect_warning(test_collection(
    "insertion_comment_interaction", "if_else_strict",
    transformer = style_text
  ), NA)
})

test_that("token are added correctly to conditional statements", {
  expect_warning(test_collection(
    "insertion_comment_interaction", "if_else_if_else_strict",
    transformer = style_text
  ), NA)
})


##  ............................................................................
##  strict = FALSE                                                          ####

test_that("token are added correctly to conditional statements", {
  expect_warning(test_collection(
    "insertion_comment_interaction", "just_if_non_strict",
    transformer = style_text, strict = FALSE
  ), NA)
})

test_that("token are added correctly to conditional statements", {
  expect_warning(test_collection(
    "insertion_comment_interaction", "if_else_non_strict",
    transformer = style_text, strict = FALSE
  ), NA)
})

test_that("token are added correctly to conditional statements", {
  expect_warning(test_collection(
    "insertion_comment_interaction", "if_else_if_else_non_strict",
    transformer = style_text, strict = FALSE
  ), NA)
})

Try the styler package in your browser

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

styler documentation built on Aug. 29, 2023, 5:10 p.m.