diff --git a/DESCRIPTION b/DESCRIPTION index a7d401163..3418e39e5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -44,7 +44,7 @@ Suggests: roxygen2, rstudioapi (>= 0.7), tibble (>= 1.4.2), - testthat (>= 3.0.0) + testthat (>= 3.2.1) VignetteBuilder: knitr Encoding: UTF-8 diff --git a/tests/testthat/test-curly-curly.R b/tests/testthat/test-curly-curly.R index 7d1008cf5..48fcc64d1 100644 --- a/tests/testthat/test-curly-curly.R +++ b/tests/testthat/test-curly-curly.R @@ -1,6 +1,6 @@ test_that("curly-culry", { - expect_warning(test_collection("curly-curly", + expect_no_warning(test_collection("curly-curly", "mixed", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-detect-alignment.R b/tests/testthat/test-detect-alignment.R index e0db9a93f..f28ae6b28 100644 --- a/tests/testthat/test-detect-alignment.R +++ b/tests/testthat/test-detect-alignment.R @@ -1,8 +1,8 @@ test_that("does apply spacing rules only if not aligned", { - expect_warning(test_collection("alignment", + expect_no_warning(test_collection("alignment", transformer = style_text - ), NA) + )) text <- "tribble(\n ~x, ~y,\n 11, list(a = 1),\n 2, list(bjj = 2)\n)" - expect_warning(style_text(text), NA) + expect_no_warning(style_text(text)) }) diff --git a/tests/testthat/test-escaping.R b/tests/testthat/test-escaping.R index f9a5c7864..18bc2cebe 100644 --- a/tests/testthat/test-escaping.R +++ b/tests/testthat/test-escaping.R @@ -1,7 +1,7 @@ test_that("escaping of characters works", { - expect_warning(test_collection("escaping", "basic", + expect_no_warning(test_collection("escaping", "basic", transformer = style_text - ), NA) + )) expect_error(test_collection("escaping", "fail-parsing-1", transformer = style_text diff --git a/tests/testthat/test-fun_dec.R b/tests/testthat/test-fun_dec.R index be01c4af6..c2a5b69d9 100644 --- a/tests/testthat/test-fun_dec.R +++ b/tests/testthat/test-fun_dec.R @@ -1,9 +1,9 @@ test_that("reindent function declaration", { - expect_warning(test_collection("fun_dec", "fun_dec_scope_spaces", + expect_no_warning(test_collection("fun_dec", "fun_dec_scope_spaces", transformer = style_text, scope = "spaces" - ), NA) + )) - expect_warning(test_collection("fun_dec", "line_break_fun_dec", + expect_no_warning(test_collection("fun_dec", "line_break_fun_dec", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-indention_curly.R b/tests/testthat/test-indention_curly.R index fe0e1d928..54b7821a9 100644 --- a/tests/testthat/test-indention_curly.R +++ b/tests/testthat/test-indention_curly.R @@ -1,30 +1,30 @@ test_that("indention on one-liner curley only is not changed", { - expect_warning(test_collection("indention_curly_brackets", + expect_no_warning(test_collection("indention_curly_brackets", "one_line_curly", transformer = style_text - ), NA) + )) }) test_that("indention with multi-line curley only is correct", { - expect_warning(test_collection("indention_curly_brackets", + expect_no_warning(test_collection("indention_curly_brackets", "multi_line_curly_only", transformer = style_text_without_curly_curly - ), NA) + )) }) test_that("indention with multi-line curley and round is correct", { - expect_warning(test_collection("indention_curly_brackets", + expect_no_warning(test_collection("indention_curly_brackets", "multi_line_curly_round_only", transformer = style_text - ), NA) + )) }) test_that("custom indention for curly braces is corretct ", { - expect_warning(test_collection("indention_curly_brackets", + expect_no_warning(test_collection("indention_curly_brackets", "custom", transformer = style_text, indent_by = 4 - ), NA) + )) }) @@ -33,13 +33,13 @@ test_that(paste( "complete styling via top-level api is correct", "(round, curly, spacing)" ), { - expect_warning(test_collection("indention_curly_brackets", + expect_no_warning(test_collection("indention_curly_brackets", "multi_line_curly_round_spacing", transformer = style_text - ), NA) + )) - expect_warning(test_collection("indention_curly_brackets", + expect_no_warning(test_collection("indention_curly_brackets", "multi_line_curly_while_for_if_fun", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-indention_fun_calls.R b/tests/testthat/test-indention_fun_calls.R index eddb4e639..643d5ef9e 100644 --- a/tests/testthat/test-indention_fun_calls.R +++ b/tests/testthat/test-indention_fun_calls.R @@ -1,5 +1,5 @@ test_that("edge cases work", { - expect_warning(test_collection("indention_fun_calls", + expect_no_warning(test_collection("indention_fun_calls", transformer = style_text, strict = FALSE - ), NA) + )) }) diff --git a/tests/testthat/test-indention_multiple.R b/tests/testthat/test-indention_multiple.R index c9d68feac..aa1523bba 100644 --- a/tests/testthat/test-indention_multiple.R +++ b/tests/testthat/test-indention_multiple.R @@ -1,57 +1,57 @@ test_that("multiple round brackets don't cause extraindention", { - expect_warning(test_collection("indention_multiple", + expect_no_warning(test_collection("indention_multiple", "round_only", transformer = style_text - ), NA) + )) - expect_warning(test_collection("indention_multiple", + expect_no_warning(test_collection("indention_multiple", "round_closing_on_same_line", transformer = style_text - ), NA) + )) }) test_that("multiple curly brackets don't cause extraindention", { - expect_warning(test_collection("indention_multiple", + expect_no_warning(test_collection("indention_multiple", "curly_only", transformer = style_text_without_curly_curly - ), NA) + )) }) test_that("multiple curly and round brackets don't cause extraindention", { - expect_warning(test_collection("indention_multiple", + expect_no_warning(test_collection("indention_multiple", "curly_and_round", transformer = style_text_without_curly_curly - ), NA) + )) }) test_that("multiple curly and round brackets overall test", { - expect_warning(test_collection("indention_multiple", + expect_no_warning(test_collection("indention_multiple", "overall", transformer = style_text - ), NA) + )) }) test_that("if and ifelse interacting with curly braces works", { - expect_warning(test_collection("indention_multiple", + expect_no_warning(test_collection("indention_multiple", "if_else_curly", transformer = style_text, strict = FALSE - ), NA) + )) }) test_that("edge cases work", { - expect_warning(test_collection("indention_multiple", + expect_no_warning(test_collection("indention_multiple", "edge_strict", transformer = style_text_without_curly_curly - ), NA) + )) }) test_that("token / braces interaction works", { - expect_warning(test_collection("indention_multiple", + expect_no_warning(test_collection("indention_multiple", "fun_for_new_line", transformer = style_text_without_curly_curly - ), NA) + )) }) diff --git a/tests/testthat/test-indention_operators.R b/tests/testthat/test-indention_operators.R index 2e7d1d4ff..fc4971a23 100644 --- a/tests/testthat/test-indention_operators.R +++ b/tests/testthat/test-indention_operators.R @@ -1,155 +1,152 @@ test_that("pipe is indended correctly", { - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "pipe", transformer = style_text - ), NA) + )) }) test_that("base pipe is indended correctly", { skip_if(getRversion() < "4.1") - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "base_pipe", transformer = style_text - ), NA) + )) }) test_that("mathematical operators are indended correctly", { - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "plus_minus", transformer = style_op - ), NA) + )) - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "multiply_divide", transformer = style_op - ), NA) + )) }) test_that("while / for / if without curly brackets", { - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "while_for_if_without_curly_non_strict", transformer = style_text, strict = FALSE - ), NA) - expect_warning(test_collection("indention_operators", + )) + expect_no_warning(test_collection("indention_operators", "while_for_without_curly_same_line_non_strict", transformer = style_text, strict = FALSE - ), NA) + )) - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "if-else-no-braces-not-strict", transformer = style_text, strict = FALSE - ), NA) + )) }) test_that("function multiline without curly brackets", { - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "function-multiline-no-braces-strict", transformer = style_text, strict = TRUE - ), NA) - expect_warning(test_collection("indention_operators", + )) + expect_no_warning(test_collection("indention_operators", "function-multiline-no-braces-non-strict", transformer = style_text, strict = FALSE - ), NA) + )) }) test_that("while / for / if without curly brackets", { - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "while_for_if_without_curly_strict", transformer = style_text, strict = TRUE - ), NA) + )) }) test_that("nested for and indention", { - expect_warning( + expect_no_warning( test_collection("indention_operators", "nested-for-spacing-scope-indention", transformer = style_text, scope = "indention" - ), - NA + ) ) - expect_warning( + expect_no_warning( test_collection("indention_operators", "nested-for-spacing-scope-spaces", transformer = style_text, scope = "spaces" - ), - NA + ) ) }) test_that("logical, special EQ_SUB and EQ_ASSIGN tokens are indented correctly", { - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "logical_special", transformer = style_text, scope = "line_breaks" - ), NA) + )) - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "eq_assign", transformer = style_text - ), NA) - expect_warning(test_collection("indention_operators", + )) + expect_no_warning(test_collection("indention_operators", "eq_formal_simple", transformer = style_text - ), NA) + )) }) test_that("dollar is indented and spaced correctly", { - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "dollar", transformer = style_text - ), NA) + )) }) test_that( "code is indented correctly if not first pontial trigger causes indention", { - expect_warning( + expect_no_warning( test_collection( "indention_operators", "not_first_trigger", transformer = style_text - ), - NA + ) ) } ) test_that("indents eq_sub correctly with various levels of scope", { - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "eq_sub_complex_indention", transformer = style_text, scope = "indention" - ), NA) + )) - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "eq_sub_complex_tokens", transformer = style_text, scope = "tokens" - ), NA) + )) }) test_that("indents eq_formals correctly with various levels of scope", { - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "eq_formals_complex_indention", transformer = style_text, scope = "indention" - ), NA) + )) - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "eq_formals_complex_tokens", transformer = style_text, scope = "tokens" - ), NA) + )) }) test_that("tilde causes indention and is flattened out", { - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "tilde", transformer = style_text - ), NA) + )) }) test_that("overall", { - expect_warning(test_collection("indention_operators", + expect_no_warning(test_collection("indention_operators", "overall", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-indention_round_brackets.R b/tests/testthat/test-indention_round_brackets.R index 1e01ade44..9257810f1 100644 --- a/tests/testthat/test-indention_round_brackets.R +++ b/tests/testthat/test-indention_round_brackets.R @@ -1,17 +1,17 @@ test_that("one-line function call yields correct indention", { - expect_warning(test_collection("indention_round_brackets", + expect_no_warning(test_collection("indention_round_brackets", "one_line", transformer = style_text - ), NA) + )) }) ## ............................................................................ test_that(paste("multi-line function call yields correct indention"), { - expect_warning(test_collection("indention_round_brackets", + expect_no_warning(test_collection("indention_round_brackets", "multi_line", transformer = style_text - ), NA) + )) }) ## ............................................................................ @@ -22,8 +22,8 @@ test_that(paste("multi-line function call yields correct indention"), { # Does NOT cover indention by operators such as +" test_that("arithmetic grouping with braces yields correctly indention", { - expect_warning(test_collection("indention_round_brackets", + expect_no_warning(test_collection("indention_round_brackets", "arithmetic", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-insertion_comment_interaction.R b/tests/testthat/test-insertion_comment_interaction.R index e9b97cdc4..5a1c08c45 100644 --- a/tests/testthat/test-insertion_comment_interaction.R +++ b/tests/testthat/test-insertion_comment_interaction.R @@ -2,24 +2,24 @@ ## strict = TRUE #### test_that("token are added correctly to conditional statements", { - expect_warning(test_collection( + expect_no_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( + expect_no_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( + expect_no_warning(test_collection( "insertion_comment_interaction", "if_else_if_else_strict", transformer = style_text - ), NA) + )) }) @@ -27,22 +27,22 @@ test_that("token are added correctly to conditional statements", { ## strict = FALSE #### test_that("token are added correctly to conditional statements", { - expect_warning(test_collection( + expect_no_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( + expect_no_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( + expect_no_warning(test_collection( "insertion_comment_interaction", "if_else_if_else_non_strict", transformer = style_text, strict = FALSE - ), NA) + )) }) diff --git a/tests/testthat/test-line_breaks_and_other.R b/tests/testthat/test-line_breaks_and_other.R index 512f09fe7..da893dc30 100644 --- a/tests/testthat/test-line_breaks_and_other.R +++ b/tests/testthat/test-line_breaks_and_other.R @@ -1,74 +1,74 @@ test_that("line breaks involing curly brackets", { - expect_warning(test_collection("line_breaks_and_other", "curly", + expect_no_warning(test_collection("line_breaks_and_other", "curly", transformer = style_text - ), NA) + )) }) test_that("line breaks involing curly brackets", { - expect_warning(test_collection("line_breaks_and_other", "braces-fun-calls", + expect_no_warning(test_collection("line_breaks_and_other", "braces-fun-calls", transformer = style_text - ), NA) + )) }) test_that("line breaks involing curly brackets", { - expect_warning(test_collection("line_breaks_and_other", "edge_comment_and_curly", + expect_no_warning(test_collection("line_breaks_and_other", "edge_comment_and_curly", transformer = style_text - ), NA) + )) }) test_that("adding and removing line breaks", { - expect_warning(test_collection("line_breaks_and_other", "if", + expect_no_warning(test_collection("line_breaks_and_other", "if", transformer = style_text - ), NA) + )) }) test_that("no line break after %>% if next token is comment", { - expect_warning(test_collection("line_breaks_and_other", "pipe_and", + expect_no_warning(test_collection("line_breaks_and_other", "pipe_and", transformer = style_text - ), NA) + )) }) test_that("line break before comma is removed and placed after comma ", { - expect_warning(test_collection("line_breaks_and_other", "comma", + expect_no_warning(test_collection("line_breaks_and_other", "comma", transformer = style_text - ), NA) + )) }) test_that("line break before comma is removed and placed after comma ", { - expect_warning(test_collection("line_breaks_and_other", "pipe-line", + expect_no_warning(test_collection("line_breaks_and_other", "pipe-line", transformer = style_text - ), NA) + )) }) test_that("Can handle base R pie", { skip_if(getRversion() < "4.1") - expect_warning(test_collection("line_breaks_and_other", "base-pipe-line", + expect_no_warning(test_collection("line_breaks_and_other", "base-pipe-line", transformer = style_text - ), NA) + )) }) test_that("line break added for ggplot2 call", { - expect_warning(test_collection("line_breaks_and_other", "ggplot2", + expect_no_warning(test_collection("line_breaks_and_other", "ggplot2", transformer = style_text - ), NA) + )) }) test_that("drop redundant line breaks in assignments", { - expect_warning(test_collection("line_breaks_and_other", "assignment", + expect_no_warning(test_collection("line_breaks_and_other", "assignment", transformer = style_text, scope = I(c("line_breaks", "tokens")) - ), NA) + )) }) test_that("line is correctly broken around = ", { - expect_warning(test_collection("line_breaks_and_other", "around-eq-sub", + expect_no_warning(test_collection("line_breaks_and_other", "around-eq-sub", transformer = style_text - ), NA) + )) }) test_that("comments are not moved down after {", { - expect_warning(test_collection("line_breaks_and_other", "comment-around-curly", + expect_no_warning(test_collection("line_breaks_and_other", "comment-around-curly", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-line_breaks_fun_call.R b/tests/testthat/test-line_breaks_fun_call.R index 375232630..dd588388b 100644 --- a/tests/testthat/test-line_breaks_fun_call.R +++ b/tests/testthat/test-line_breaks_fun_call.R @@ -1,63 +1,63 @@ test_that("line breaks work in general", { - expect_warning(test_collection("line_breaks_fun_call", + expect_no_warning(test_collection("line_breaks_fun_call", "token_dependent_mixed", transformer = style_text - ), NA) + )) - expect_warning(test_collection("line_breaks_fun_call", + expect_no_warning(test_collection("line_breaks_fun_call", "token_dependent_complex_strict", transformer = style_text - ), NA) + )) }) test_that("blank lines in function calls are removed for strict = TRUE", { - expect_warning(test_collection("line_breaks_fun_call", + expect_no_warning(test_collection("line_breaks_fun_call", "blank-strict", transformer = style_text - ), NA) + )) - expect_warning(test_collection("line_breaks_fun_call", + expect_no_warning(test_collection("line_breaks_fun_call", "blank-non-strict", transformer = style_text, strict = FALSE - ), NA) + )) }) test_that("line breaks are not applied with non-strict", { - expect_warning(test_collection("line_breaks_fun_call", + expect_no_warning(test_collection("line_breaks_fun_call", "token_dependent_complex_non_strict", transformer = style_text, strict = FALSE - ), NA) + )) }) test_that("line breaks work with comments", { - expect_warning(test_collection("line_breaks_fun_call", + expect_no_warning(test_collection("line_breaks_fun_call", "token_dependent_comments", transformer = style_text - ), NA) - expect_warning(test_collection("line_breaks_fun_call", + )) + expect_no_warning(test_collection("line_breaks_fun_call", "line_breaks_and_comments", transformer = style_text - ), NA) + )) }) test_that("line breaks work with exceptions", { - expect_warning(test_collection("line_breaks_fun_call", + expect_no_warning(test_collection("line_breaks_fun_call", "switch_ifelse", transformer = style_text - ), NA) + )) }) test_that("line breaks work with exceptions", { - expect_warning(test_collection("line_breaks_fun_call", + expect_no_warning(test_collection("line_breaks_fun_call", "named_arguments", transformer = style_text - ), NA) + )) }) test_that("line breaks work with exceptions", { - expect_warning(test_collection("line_breaks_fun_call", + expect_no_warning(test_collection("line_breaks_fun_call", "unindent", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-math_token_spacing.R b/tests/testthat/test-math_token_spacing.R index dd03370f0..4e0c94574 100644 --- a/tests/testthat/test-math_token_spacing.R +++ b/tests/testthat/test-math_token_spacing.R @@ -10,39 +10,39 @@ test_that("invalid tokens return error", { }) test_that("non-strict default: spacing around all", { - expect_warning(test_collection( + expect_no_warning(test_collection( "math_token_spacing", "non_strict_math_spacing_all", transformer = style_text, style = tidyverse_style, scope = "spaces", math_token_spacing = specify_math_token_spacing(), strict = FALSE - ), NA) + )) }) test_that("strict default: spacing around all", { - expect_warning(test_collection( + expect_no_warning(test_collection( "math_token_spacing", "strict_math_spacing_all", transformer = style_text, style = tidyverse_style, scope = "spaces", math_token_spacing = tidyverse_math_token_spacing(), strict = TRUE - ), NA) + )) }) test_that("strict no space around +", { - expect_warning(test_collection( + expect_no_warning(test_collection( "math_token_spacing", "strict_math_spacing_zero_plus", transformer = style_text, style = tidyverse_style, scope = "spaces", math_token_spacing = specify_math_token_spacing(zero = "'+'") - ), NA) + )) }) test_that("strict no space around all but ^", { - expect_warning(test_collection( + expect_no_warning(test_collection( "math_token_spacing", "strict_math_spacing_zero_all_but_power", transformer = style_text, style = tidyverse_style, @@ -50,5 +50,5 @@ test_that("strict no space around all but ^", { math_token_spacing = specify_math_token_spacing(zero = c( "'+'", "'-'", "'/'", "'*'" )) - ), NA) + )) }) diff --git a/tests/testthat/test-multiple_expressions.R b/tests/testthat/test-multiple_expressions.R index 783f012dd..6b8c0ecd3 100644 --- a/tests/testthat/test-multiple_expressions.R +++ b/tests/testthat/test-multiple_expressions.R @@ -2,15 +2,15 @@ library("testthat") test_that("simple multiple expressions are styled correctly", { - expect_warning(test_collection("multiple_expressions", + expect_no_warning(test_collection("multiple_expressions", "two_simple", transformer = style_text - ), NA) + )) }) test_that("complex multiple expressions are styled correctly", { - expect_warning(test_collection("multiple_expressions", + expect_no_warning(test_collection("multiple_expressions", "three_complex", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-parse_comments.R b/tests/testthat/test-parse_comments.R index 53ec3e9b3..99c17a623 100644 --- a/tests/testthat/test-parse_comments.R +++ b/tests/testthat/test-parse_comments.R @@ -1,74 +1,74 @@ test_that("spacing within comments is done correctly", { - expect_warning(test_collection("parse_comments", + expect_no_warning(test_collection("parse_comments", "within_spacing_with_force", transformer = style_text, style = tidyverse_style, start_comments_with_one_space = TRUE - ), NA) + )) - expect_warning(test_collection("parse_comments", + expect_no_warning(test_collection("parse_comments", "within_spacing_without_force", transformer = style_text, style = tidyverse_style, start_comments_with_one_space = FALSE - ), NA) + )) - expect_warning(test_collection("parse_comments", + expect_no_warning(test_collection("parse_comments", "eol_eof_spaces", transformer = style_text - ), NA) + )) }) test_that("comments are treated corectly", { - expect_warning(test_collection("parse_comments", + expect_no_warning(test_collection("parse_comments", "mixed", transformer = style_empty - ), NA) + )) - expect_warning(test_collection("parse_comments", + expect_no_warning(test_collection("parse_comments", "just_comments", transformer = style_empty - ), NA) + )) - expect_warning(test_collection("parse_comments", + expect_no_warning(test_collection("parse_comments", "with_indention", transformer = style_text - ), NA) + )) }) test_that("rplumber tags / syntax is handled properly", { - expect_warning(test_collection("parse_comments", + expect_no_warning(test_collection("parse_comments", "rplumber", transformer = style_text - ), NA) + )) }) test_that("hashbangs are respected", { - expect_warning(test_collection("parse_comments", + expect_no_warning(test_collection("parse_comments", "shebang", transformer = style_text - ), NA) + )) }) test_that("xaringan markers are respected", { - expect_warning(test_collection("parse_comments", + expect_no_warning(test_collection("parse_comments", "xaringan", transformer = style_text - ), NA) + )) }) test_that("output prefix markers are respected", { - expect_warning(test_collection("parse_comments", + expect_no_warning(test_collection("parse_comments", "output-prefix", transformer = style_text - ), NA) + )) }) test_that("code chunk headers for spinning are respected", { - expect_warning(test_collection("parse_comments", + expect_no_warning(test_collection("parse_comments", "spinning_code_chunk_headers", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-parsing.R b/tests/testthat/test-parsing.R index 6f37f806e..6935bac49 100644 --- a/tests/testthat/test-parsing.R +++ b/tests/testthat/test-parsing.R @@ -1,7 +1,6 @@ test_that("long strings are parsed correctly", { - expect_warning( - test_collection("parsing", "long_strings", transformer = style_text), - NA + expect_no_warning( + test_collection("parsing", "long_strings", transformer = style_text) ) }) diff --git a/tests/testthat/test-relocate_eq_assign.R b/tests/testthat/test-relocate_eq_assign.R index 0fbcd40b8..0ea30900f 100644 --- a/tests/testthat/test-relocate_eq_assign.R +++ b/tests/testthat/test-relocate_eq_assign.R @@ -43,35 +43,35 @@ test_that("tree hierarchy is the same no matter whether = or <- is used", { }) test_that("braces are added in the right place in ifelse if eq_assign is in expr", { - expect_warning(test_collection( + expect_no_warning(test_collection( "relocate_eq_assign", "eq_assign_ifelse_scope_tokens", transformer = style_text, style = tidyverse_style - ), NA) + )) }) test_that("complicated reassignment works", { - expect_warning(test_collection( + expect_no_warning(test_collection( "relocate_eq_assign", "eq_assign_multiple_tokens_eq_only", transformer = style_text, scope = "tokens", style = tidyverse_style - ), NA) + )) - expect_warning(test_collection( + expect_no_warning(test_collection( "relocate_eq_assign", "eq_assign_multiple_tokens_mixed", transformer = style_text, scope = "tokens", style = tidyverse_style - ), NA) + )) }) test_that("eq_assign is not replaced", { - expect_warning(test_collection( + expect_no_warning(test_collection( "relocate_eq_assign", "eq_assign_ifelse_scope_line_breaks", transformer = style_text, scope = "line_breaks", style = tidyverse_style - ), NA) + )) }) diff --git a/tests/testthat/test-rmd.R b/tests/testthat/test-rmd.R index 79811ba60..229a0e18a 100644 --- a/tests/testthat/test-rmd.R +++ b/tests/testthat/test-rmd.R @@ -1,57 +1,57 @@ test_that("can style .Rmd files", { - expect_warning(test_collection("rmd", "simple", + expect_no_warning(test_collection("rmd", "simple", transformer = transform_mixed, transformer_fun = style_text, filetype = "Rmd", write_tree = FALSE - ), NA) + )) - expect_warning(test_collection("rmd", "r_and_non_r_code_chunks", + expect_no_warning(test_collection("rmd", "r_and_non_r_code_chunks", transformer = transform_mixed, transformer_fun = style_text, filetype = "Rmd", write_tree = FALSE - ), NA) + )) - expect_warning(test_collection("rmd", "nested", + expect_no_warning(test_collection("rmd", "nested", transformer = transform_mixed, transformer_fun = style_text, filetype = "Rmd", write_tree = FALSE - ), NA) + )) - expect_warning(test_collection("rmd", "invalid", + expect_no_warning(test_collection("rmd", "invalid", transformer = transform_mixed, transformer_fun = style_text, filetype = "Rmd", write_tree = FALSE - ), NA) + )) ## new 3-5 - expect_warning(test_collection("rmd", "random3", + expect_no_warning(test_collection("rmd", "random3", transformer = transform_mixed, transformer_fun = style_text, filetype = "Rmd", write_tree = FALSE - ), NA) - expect_warning(test_collection("rmd", "random5", + )) + expect_no_warning(test_collection("rmd", "random5", transformer = transform_mixed, transformer_fun = style_text, filetype = "Rmd", write_tree = FALSE - ), NA) - expect_warning(test_collection("rmd", "random6", + )) + expect_no_warning(test_collection("rmd", "random6", transformer = transform_mixed, transformer_fun = style_text, filetype = "Rmd", write_tree = FALSE - ), NA) - expect_warning(test_collection("rmd", "random7", + )) + expect_no_warning(test_collection("rmd", "random7", transformer = transform_mixed, transformer_fun = style_text, filetype = "Rmd", write_tree = FALSE - ), NA) + )) }) diff --git a/tests/testthat/test-rnw.R b/tests/testthat/test-rnw.R index 206d63b89..617c4ed4f 100644 --- a/tests/testthat/test-rnw.R +++ b/tests/testthat/test-rnw.R @@ -1,16 +1,16 @@ test_that("can style .Rnw files", { - expect_warning(test_collection( + expect_no_warning(test_collection( "rnw", "008-outdec", transformer = transform_mixed, transformer_fun = style_text, filetype = "Rnw", write_tree = FALSE - ), NA) - expect_warning(test_collection( + )) + expect_no_warning(test_collection( "rnw", "011-conditional-eval", transformer = transform_mixed, transformer_fun = style_text, filetype = "Rnw", write_tree = FALSE - ), NA) + )) }) diff --git a/tests/testthat/test-roxygen-examples-complete-01.R b/tests/testthat/test-roxygen-examples-complete-01.R index 6e6e65c9b..994ef26d3 100644 --- a/tests/testthat/test-roxygen-examples-complete-01.R +++ b/tests/testthat/test-roxygen-examples-complete-01.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 01", { - expect_warning(test_collection("roxygen-examples-complete", "^01-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^01-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-02.R b/tests/testthat/test-roxygen-examples-complete-02.R index b04e9dcb8..a32a2f842 100644 --- a/tests/testthat/test-roxygen-examples-complete-02.R +++ b/tests/testthat/test-roxygen-examples-complete-02.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 02", { - expect_warning(test_collection("roxygen-examples-complete", "^02-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^02-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-03.R b/tests/testthat/test-roxygen-examples-complete-03.R index ce0a3222a..08265d7ac 100644 --- a/tests/testthat/test-roxygen-examples-complete-03.R +++ b/tests/testthat/test-roxygen-examples-complete-03.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 03", { - expect_warning(test_collection("roxygen-examples-complete", "^03-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^03-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-04.R b/tests/testthat/test-roxygen-examples-complete-04.R index cd2b273af..883a90afe 100644 --- a/tests/testthat/test-roxygen-examples-complete-04.R +++ b/tests/testthat/test-roxygen-examples-complete-04.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 04", { - expect_warning(test_collection("roxygen-examples-complete", "^04-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^04-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-05.R b/tests/testthat/test-roxygen-examples-complete-05.R index b6eb4381c..5757c5d76 100644 --- a/tests/testthat/test-roxygen-examples-complete-05.R +++ b/tests/testthat/test-roxygen-examples-complete-05.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 05", { - expect_warning(test_collection("roxygen-examples-complete", "^05-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^05-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-06.R b/tests/testthat/test-roxygen-examples-complete-06.R index 7ea758c03..246be9f85 100644 --- a/tests/testthat/test-roxygen-examples-complete-06.R +++ b/tests/testthat/test-roxygen-examples-complete-06.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 06", { - expect_warning(test_collection("roxygen-examples-complete", "^06-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^06-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-07.R b/tests/testthat/test-roxygen-examples-complete-07.R index e81ad2583..d45cf07ce 100644 --- a/tests/testthat/test-roxygen-examples-complete-07.R +++ b/tests/testthat/test-roxygen-examples-complete-07.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 07", { - expect_warning(test_collection("roxygen-examples-complete", "^07-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^07-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-08.R b/tests/testthat/test-roxygen-examples-complete-08.R index 8b5ed8bd4..ed70c49fa 100644 --- a/tests/testthat/test-roxygen-examples-complete-08.R +++ b/tests/testthat/test-roxygen-examples-complete-08.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 08", { - expect_warning(test_collection("roxygen-examples-complete", "^08-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^08-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-09.R b/tests/testthat/test-roxygen-examples-complete-09.R index 464b937ca..b92ed8791 100644 --- a/tests/testthat/test-roxygen-examples-complete-09.R +++ b/tests/testthat/test-roxygen-examples-complete-09.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 09", { - expect_warning(test_collection("roxygen-examples-complete", "^09-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^09-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-10.R b/tests/testthat/test-roxygen-examples-complete-10.R index 125bee5e2..b13b6efa7 100644 --- a/tests/testthat/test-roxygen-examples-complete-10.R +++ b/tests/testthat/test-roxygen-examples-complete-10.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 10", { - expect_warning(test_collection("roxygen-examples-complete", "^10-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^10-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-11.R b/tests/testthat/test-roxygen-examples-complete-11.R index 041683ea9..d2998cb78 100644 --- a/tests/testthat/test-roxygen-examples-complete-11.R +++ b/tests/testthat/test-roxygen-examples-complete-11.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 11", { - expect_warning(test_collection("roxygen-examples-complete", "^11-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^11-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-12.R b/tests/testthat/test-roxygen-examples-complete-12.R index 7cdb1af67..9d190901d 100644 --- a/tests/testthat/test-roxygen-examples-complete-12.R +++ b/tests/testthat/test-roxygen-examples-complete-12.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 12", { - expect_warning(test_collection("roxygen-examples-complete", "^12-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^12-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-13.R b/tests/testthat/test-roxygen-examples-complete-13.R index 0bd1d9a63..87c9a28d2 100644 --- a/tests/testthat/test-roxygen-examples-complete-13.R +++ b/tests/testthat/test-roxygen-examples-complete-13.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 13", { - expect_warning(test_collection("roxygen-examples-complete", "^13-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^13-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-14.R b/tests/testthat/test-roxygen-examples-complete-14.R index a93c20704..cb675af50 100644 --- a/tests/testthat/test-roxygen-examples-complete-14.R +++ b/tests/testthat/test-roxygen-examples-complete-14.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 14", { - expect_warning(test_collection("roxygen-examples-complete", "^14-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^14-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-15.R b/tests/testthat/test-roxygen-examples-complete-15.R index 243697af7..7878baeab 100644 --- a/tests/testthat/test-roxygen-examples-complete-15.R +++ b/tests/testthat/test-roxygen-examples-complete-15.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 15", { - expect_warning(test_collection("roxygen-examples-complete", "^15-", transformer = style_text, scope = "spaces"), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^15-", transformer = style_text, scope = "spaces")) }) diff --git a/tests/testthat/test-roxygen-examples-complete-16.R b/tests/testthat/test-roxygen-examples-complete-16.R index 40b577824..e2a94fba6 100644 --- a/tests/testthat/test-roxygen-examples-complete-16.R +++ b/tests/testthat/test-roxygen-examples-complete-16.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 16", { - expect_warning(test_collection("roxygen-examples-complete", "^16-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^16-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-17.R b/tests/testthat/test-roxygen-examples-complete-17.R index cd8f2ee19..2593baed5 100644 --- a/tests/testthat/test-roxygen-examples-complete-17.R +++ b/tests/testthat/test-roxygen-examples-complete-17.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 17", { - expect_warning(test_collection("roxygen-examples-complete", "^17-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^17-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-18.R b/tests/testthat/test-roxygen-examples-complete-18.R index 53497fe61..a35120f36 100644 --- a/tests/testthat/test-roxygen-examples-complete-18.R +++ b/tests/testthat/test-roxygen-examples-complete-18.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 18", { - expect_warning(test_collection("roxygen-examples-complete", "^18-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^18-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-19.R b/tests/testthat/test-roxygen-examples-complete-19.R index 26d44dd98..f007ef7be 100644 --- a/tests/testthat/test-roxygen-examples-complete-19.R +++ b/tests/testthat/test-roxygen-examples-complete-19.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 19", { - expect_warning(test_collection("roxygen-examples-complete", "^19-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^19-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-20.R b/tests/testthat/test-roxygen-examples-complete-20.R index 8ea8533b0..1f9f402a9 100644 --- a/tests/testthat/test-roxygen-examples-complete-20.R +++ b/tests/testthat/test-roxygen-examples-complete-20.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 20", { - expect_warning(test_collection("roxygen-examples-complete", "^20-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^20-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-21.R b/tests/testthat/test-roxygen-examples-complete-21.R index 2531a16cb..23f49d568 100644 --- a/tests/testthat/test-roxygen-examples-complete-21.R +++ b/tests/testthat/test-roxygen-examples-complete-21.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 21", { - expect_warning(test_collection("roxygen-examples-complete", "^21-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^21-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-22.R b/tests/testthat/test-roxygen-examples-complete-22.R index 087415675..4295e5b20 100644 --- a/tests/testthat/test-roxygen-examples-complete-22.R +++ b/tests/testthat/test-roxygen-examples-complete-22.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 22", { - expect_warning(test_collection("roxygen-examples-complete", "^22-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^22-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-24.R b/tests/testthat/test-roxygen-examples-complete-24.R index af6550d67..8177615d4 100644 --- a/tests/testthat/test-roxygen-examples-complete-24.R +++ b/tests/testthat/test-roxygen-examples-complete-24.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 24", { - expect_warning(test_collection("roxygen-examples-complete", "^24-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^24-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-25.R b/tests/testthat/test-roxygen-examples-complete-25.R index 88412a341..0c610e2d4 100644 --- a/tests/testthat/test-roxygen-examples-complete-25.R +++ b/tests/testthat/test-roxygen-examples-complete-25.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 25", { - expect_warning(test_collection("roxygen-examples-complete", "^25-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^25-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-26.R b/tests/testthat/test-roxygen-examples-complete-26.R index 6d741da8b..cedbbe026 100644 --- a/tests/testthat/test-roxygen-examples-complete-26.R +++ b/tests/testthat/test-roxygen-examples-complete-26.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 26", { - expect_warning(test_collection("roxygen-examples-complete", "^26-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^26-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-27.R b/tests/testthat/test-roxygen-examples-complete-27.R index ef2beb0fa..4831e133c 100644 --- a/tests/testthat/test-roxygen-examples-complete-27.R +++ b/tests/testthat/test-roxygen-examples-complete-27.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 27", { - expect_warning(test_collection("roxygen-examples-complete", "^27-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^27-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-28.R b/tests/testthat/test-roxygen-examples-complete-28.R index bdc2d75fa..ffcc436c8 100644 --- a/tests/testthat/test-roxygen-examples-complete-28.R +++ b/tests/testthat/test-roxygen-examples-complete-28.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 28", { - expect_warning(test_collection("roxygen-examples-complete", "^28-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^28-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-29.R b/tests/testthat/test-roxygen-examples-complete-29.R index 354b791fd..10873f663 100644 --- a/tests/testthat/test-roxygen-examples-complete-29.R +++ b/tests/testthat/test-roxygen-examples-complete-29.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 29", { - expect_warning(test_collection("roxygen-examples-complete", "^29-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^29-", transformer = style_text)) }) diff --git a/tests/testthat/test-roxygen-examples-complete-30.R b/tests/testthat/test-roxygen-examples-complete-30.R index f81bab588..1e47a7388 100644 --- a/tests/testthat/test-roxygen-examples-complete-30.R +++ b/tests/testthat/test-roxygen-examples-complete-30.R @@ -1,5 +1,5 @@ # NB: DO NOT EDIT. Auto-generated by ./tests/dev/generate_roxygen_tests.R. test_that("analogous to test-roxygen-examples-complete: 30", { - expect_warning(test_collection("roxygen-examples-complete", "^30-", transformer = style_text), NA) + expect_no_warning(test_collection("roxygen-examples-complete", "^30-", transformer = style_text)) }) diff --git a/tests/testthat/test-scope-AsIs.R b/tests/testthat/test-scope-AsIs.R index 5ea573ca2..da1638a32 100644 --- a/tests/testthat/test-scope-AsIs.R +++ b/tests/testthat/test-scope-AsIs.R @@ -1,70 +1,70 @@ test_that("no indention manipulation but spaces manipulation", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-AsIs", "scope_spaces-", transformer = style_text, style = tidyverse_style, scope = I("spaces") - ), NA) + )) }) test_that("just indention", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-AsIs", "scope_indention-", transformer = style_text, style = tidyverse_style, scope = I("indention") - ), NA) + )) }) test_that("indention and spaces", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-AsIs", "scope_spaces_indention-", transformer = style_text, style = tidyverse_style, scope = I(c("indention", "spaces")) - ), NA) + )) }) test_that("line-break manipulation", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-AsIs", "scope_line_breaks-", transformer = style_text, style = tidyverse_style, scope = I("line_breaks") - ), NA) + )) }) test_that("line-break manipulation", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-AsIs", "scope_spaces_line_breaks-", transformer = style_text, style = tidyverse_style, scope = I(c("line_breaks", "spaces")) - ), NA) + )) }) test_that("tokens and indention", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-AsIs", "scope_indention_tokens-", transformer = style_text, style = tidyverse_style, scope = I(c("tokens", "indention")) - ), NA) + )) }) test_that("tokens and indention", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-AsIs", "scope_spaces_tokens-", transformer = style_text, style = tidyverse_style, scope = I(c("spaces", "tokens")) - ), NA) + )) }) test_that("no manipulation at all", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-AsIs", "scope_none-", transformer = style_text, style = tidyverse_style, scope = I("none") - ), NA) + )) }) diff --git a/tests/testthat/test-scope-character.R b/tests/testthat/test-scope-character.R index ef7ee0d2d..3cc82b55c 100644 --- a/tests/testthat/test-scope-character.R +++ b/tests/testthat/test-scope-character.R @@ -1,43 +1,43 @@ test_that("no indention manipulation but spaces manipulation", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-character", "scope_spaces", transformer = style_text, style = tidyverse_style, scope = "spaces" - ), NA) + )) }) test_that("no line-break manipulation", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-character", "scope_indention", transformer = style_text, style = tidyverse_style, scope = "indention" - ), NA) + )) }) test_that("no token manipulation", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-character", "scope_line_breaks", transformer = style_text, style = tidyverse_style, scope = "line_breaks" - ), NA) + )) }) test_that("no space manipulation", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-character", "scope_tokens", transformer = style_text, style = tidyverse_style, scope = "tokens" - ), NA) + )) }) test_that("no manipulation at all", { - expect_warning(test_collection( + expect_no_warning(test_collection( "scope-character", "scope_none", transformer = style_text, style = tidyverse_style, scope = "none" - ), NA) + )) }) diff --git a/tests/testthat/test-spacing.R b/tests/testthat/test-spacing.R index 20ae4c695..aa7bdb997 100644 --- a/tests/testthat/test-spacing.R +++ b/tests/testthat/test-spacing.R @@ -1,85 +1,85 @@ test_that("curly braces", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "round", transformer = style_text - ), NA) + )) }) test_that(":, ::, and :::", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "colon", transformer = style_text - ), NA) + )) }) test_that("comments and strict = FALSE", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "comments", transformer = style_text, stric = FALSE - ), NA) + )) }) test_that("Space placed after 'if' and before '('", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "spacing_if", transformer = style_text - ), NA) + )) }) test_that("space before comma is removed", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "spacing_comma", transformer = style_text - ), NA) + )) }) test_that("two commas are separated by a space", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "spacing_comma2", transformer = style_text - ), NA) + )) }) test_that("spacing between ! and bang is perserved", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "bang_bang_spacing", transformer = style_text - ), NA) + )) }) test_that("spacing around in works", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "spacing_in", transformer = style_text - ), NA) + )) }) test_that("no spaces after token FUNCTION", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "spacing_function", transformer = style_text, strict = FALSE - ), NA) + )) }) test_that("spacing around tilde", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "spacing-tilde", transformer = style_text, strict = TRUE - ), NA) + )) }) test_that("spacing around square brackets / braces", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "spacing-square", transformer = style_text, strict = TRUE - ), NA) + )) }) test_that("spacing around dollar", { - expect_warning(test_collection( + expect_no_warning(test_collection( "spacing", "dollar", transformer = style_text, strict = TRUE - ), NA) + )) }) diff --git a/tests/testthat/test-square_brackets.R b/tests/testthat/test-square_brackets.R index 7f4c4d481..7c4ef65a4 100644 --- a/tests/testthat/test-square_brackets.R +++ b/tests/testthat/test-square_brackets.R @@ -1,6 +1,6 @@ test_that("square brackets cause indention", { - expect_warning(test_collection( + expect_no_warning(test_collection( "indention_square_brackets", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-start_line.R b/tests/testthat/test-start_line.R index bb17a2aad..5d96cc2b2 100644 --- a/tests/testthat/test-start_line.R +++ b/tests/testthat/test-start_line.R @@ -1,5 +1,5 @@ test_that("leading spaces are preserved at start of text", { - expect_warning(test_collection("start_line", + expect_no_warning(test_collection("start_line", transformer = style_empty - ), NA) + )) }) diff --git a/tests/testthat/test-strict.R b/tests/testthat/test-strict.R index da8ea93e4..bf6e92a40 100644 --- a/tests/testthat/test-strict.R +++ b/tests/testthat/test-strict.R @@ -1,31 +1,31 @@ test_that("can style example source file with strict = TRUE", { - expect_warning(test_collection( + expect_no_warning(test_collection( "strict", "strict", transformer = style_text, strict = TRUE - ), NA) + )) }) test_that("can style example source file with strict = FALSE", { - expect_warning(test_collection( + expect_no_warning(test_collection( "strict", "non_strict", transformer = style_text, strict = FALSE - ), NA) + )) }) test_that("removes space at EOL", { - expect_warning(test_collection( + expect_no_warning(test_collection( "strict", "eol", transformer = style_text, strict = FALSE - ), NA) + )) }) test_that("removes blank lines at EOF", { - expect_warning(test_collection( + expect_no_warning(test_collection( "strict", "eof", transformer = style_text, strict = FALSE - ), NA) + )) }) diff --git a/tests/testthat/test-stylerignore.R b/tests/testthat/test-stylerignore.R index e17fb9adf..925f91143 100644 --- a/tests/testthat/test-stylerignore.R +++ b/tests/testthat/test-stylerignore.R @@ -127,31 +127,31 @@ test_that("works with other markers", { test_that("Simple example works", { - expect_warning(test_collection("stylerignore", "simple", + expect_no_warning(test_collection("stylerignore", "simple", transformer = style_text - ), NA) + )) }) test_that("stylerignore does not need coincidence with top-level expressions", { - expect_warning(test_collection("stylerignore", "crossing", + expect_no_warning(test_collection("stylerignore", "crossing", transformer = style_text - ), NA) + )) }) test_that("token adding or removing works in stylerignore", { - expect_warning(test_collection("stylerignore", "adding-removing", + expect_no_warning(test_collection("stylerignore", "adding-removing", transformer = style_text - ), NA) + )) }) test_that("no token added or removed in complex case", { - expect_warning(test_collection("stylerignore", "braces", + expect_no_warning(test_collection("stylerignore", "braces", transformer = style_text - ), NA) + )) }) test_that("stylerignore sequences are respected in alignment detection", { - expect_warning(test_collection("stylerignore", "alignment", + expect_no_warning(test_collection("stylerignore", "alignment", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-tidyeval.R b/tests/testthat/test-tidyeval.R index 5d1c074f6..45192320c 100644 --- a/tests/testthat/test-tidyeval.R +++ b/tests/testthat/test-tidyeval.R @@ -1,17 +1,17 @@ test_that("no spaces within bang-bang operator !!!", { - expect_warning(test_collection("tidyeval", "bang_bang", + expect_no_warning(test_collection("tidyeval", "bang_bang", transformer = style_text - ), NA) + )) }) test_that(":= has correct spacing", { - expect_warning(test_collection("tidyeval", "setting_var", + expect_no_warning(test_collection("tidyeval", "setting_var", transformer = style_text - ), NA) + )) }) test_that("Space before comma if preceding token is EQ_SUB", { - expect_warning(test_collection("tidyeval", "eq_sub", + expect_no_warning(test_collection("tidyeval", "eq_sub", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-token_adding_removing.R b/tests/testthat/test-token_adding_removing.R index 47ad6703d..584f7f9b9 100644 --- a/tests/testthat/test-token_adding_removing.R +++ b/tests/testthat/test-token_adding_removing.R @@ -1,63 +1,63 @@ test_that("other manipulations are correct (add braces, semi-colon etc.)", { - expect_warning(test_collection("token_adding_removing", "mixed_token", + expect_no_warning(test_collection("token_adding_removing", "mixed_token", transformer = style_text - ), NA) + )) }) test_that("braces in if-else clause are added correctly", { - expect_warning(test_collection("token_adding_removing", "if_else_strict", + expect_no_warning(test_collection("token_adding_removing", "if_else_strict", transformer = style_text - ), NA) - expect_warning(test_collection("token_adding_removing", "if_else_non_strict", + )) + expect_no_warning(test_collection("token_adding_removing", "if_else_non_strict", transformer = style_text, strict = FALSE - ), NA) - expect_warning(test_collection("token_adding_removing", "if-else-comma", + )) + expect_no_warning(test_collection("token_adding_removing", "if-else-comma", transformer = style_text, strict = TRUE - ), NA) + )) }) test_that("double braces are treated correctly", { - expect_warning(test_collection("token_adding_removing", "double_braces", + expect_no_warning(test_collection("token_adding_removing", "double_braces", transformer = style_text - ), NA) + )) }) test_that("double braces are treated correctly", { - expect_warning(test_collection("token_adding_removing", "token_creation_find_pos", + expect_no_warning(test_collection("token_adding_removing", "token_creation_find_pos", transformer = style_text - ), NA) + )) }) test_that("braces only added to pipe if RHS is a symbol", { - expect_warning(test_collection("token_adding_removing", "add_brackets_in_pipe", + expect_no_warning(test_collection("token_adding_removing", "add_brackets_in_pipe", transformer = style_text - ), NA) + )) }) test_that("No braces are added if conditional statement is within pipe", { - expect_warning(test_collection("token_adding_removing", "else-pipe", + expect_no_warning(test_collection("token_adding_removing", "else-pipe", transformer = style_text - ), NA) + )) }) test_that("No brace is added within `substitute()`", { - expect_warning(test_collection("token_adding_removing", "substitute", + expect_no_warning(test_collection("token_adding_removing", "substitute", transformer = style_text - ), NA) + )) }) test_that("stylreignore interacts correctly with wrap_expr_in_curly", { - expect_warning(test_collection("token_adding_removing", "if_else_stylerignore", + expect_no_warning(test_collection("token_adding_removing", "if_else_stylerignore", transformer = style_text - ), NA) + )) }) test_that("stylreignore interacts correctly with wrap_expr_in_curly", { - expect_warning(test_collection("token_adding_removing", "for_while_stylerignore", + expect_no_warning(test_collection("token_adding_removing", "for_while_stylerignore", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-unary.R b/tests/testthat/test-unary.R index 264e58ae7..0c5cc2b30 100644 --- a/tests/testthat/test-unary.R +++ b/tests/testthat/test-unary.R @@ -1,16 +1,16 @@ test_that("no spaces before unary operator", { - expect_warning(test_collection("unary_spacing", + expect_no_warning(test_collection("unary_spacing", "unary_simple", transformer = style_text - ), NA) + )) - expect_warning(test_collection("unary_spacing", + expect_no_warning(test_collection("unary_spacing", "unary_complex", transformer = style_text - ), NA) + )) - expect_warning(test_collection("unary_spacing", + expect_no_warning(test_collection("unary_spacing", "unary_indention", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-unindention.R b/tests/testthat/test-unindention.R index ea48778d1..0d6058d6a 100644 --- a/tests/testthat/test-unindention.R +++ b/tests/testthat/test-unindention.R @@ -1,15 +1,15 @@ test_that("round brackets are unindented correctly", { - expect_warning(test_collection("unindention", + expect_no_warning(test_collection("unindention", "mixed", transformer = style_text_without_curly_curly - ), NA) + )) }) test_that("tokens are not dropped in named vector", { - expect_warning(test_collection("unindention", + expect_no_warning(test_collection("unindention", "vec", transformer = style_text - ), NA) + )) }) @@ -17,8 +17,8 @@ test_that(paste( "if last token is multi-line and no line break precede,", "unindention is correct" ), { - expect_warning(test_collection("unindention", + expect_no_warning(test_collection("unindention", "vec", transformer = style_text - ), NA) + )) }) diff --git a/tests/testthat/test-unindention_regex.R b/tests/testthat/test-unindention_regex.R index 1eace2b0b..e009b67e1 100644 --- a/tests/testthat/test-unindention_regex.R +++ b/tests/testthat/test-unindention_regex.R @@ -1,20 +1,20 @@ test_that("forced regex token-dependent indention", { - expect_warning(test_collection( + expect_no_warning(test_collection( "unindention_regex", "regex_force_with", transformer = style_text, reindention = specify_reindention(c( "^# ", "^## ", "^### " )) - ), NA) + )) }) test_that("do not force regex token-dependent indention without pattern", { - expect_warning(test_collection( + expect_no_warning(test_collection( "unindention_regex", "regex_force_no", transformer = style_text, reindention = specify_reindention(NULL) - ), NA) + )) })