Skip to content

Commit

Permalink
typo and merge conflict fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gergness committed Jul 30, 2020
1 parent 1dd4b18 commit c1833c1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion R/case-when-variable.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' side is where to get the value if the condition on the left-hand side is
#' true. This must be either a Crunch Categorical variable or a Category.
#'
#' @param ... formulas where the left hand side is a CrunchExpression (or `TRUE`
#' @param ... formulas where the left hand side is a `CrunchLogicalExpression` (or `TRUE`
#' to indicate the "else" case that will be met if all the other expression are
#' not met) and the right hand side is a CrunchVariable that should be filled in,
#' a `Category` object describing the Category it should be used, a string
Expand Down
2 changes: 1 addition & 1 deletion man/makeCaseWhenVariable.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions tests/testthat/test-case-when-variable.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ with_mock_crunch({
expect_equal(
unclass(toJSON(
caseWhenExpr(
between(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
between(ds$birthyr, 1980, 1990) ~ ds$gender,
crunchBetween(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
crunchBetween(ds$birthyr, 1980, 1990) ~ ds$gender,
TRUE ~ Category(name = "Missed Q", missing = TRUE)
)@expression
)),
Expand All @@ -61,14 +61,14 @@ with_mock_crunch({
test_that("caseWhenExpr handles formulas argument", {
expect_equal(
caseWhenExpr(
between(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
between(ds$birthyr, 1980, 1990) ~ ds$gender,
crunchBetween(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
crunchBetween(ds$birthyr, 1980, 1990) ~ ds$gender,
TRUE ~ Category(name = "Missed Q", missing = TRUE)
),
caseWhenExpr(
formulas = list(
between(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
between(ds$birthyr, 1980, 1990) ~ ds$gender,
crunchBetween(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
crunchBetween(ds$birthyr, 1980, 1990) ~ ds$gender,
TRUE ~ Category(name = "Missed Q", missing = TRUE)
)
)
Expand All @@ -78,14 +78,14 @@ with_mock_crunch({
test_that("caseWhenExpr handles data argument", {
expect_equal(
caseWhenExpr(
between(birthyr, 1970, 1980) ~ Category(name = "Hello"),
between(birthyr, 1980, 1990) ~ gender,
crunchBetween(birthyr, 1970, 1980) ~ Category(name = "Hello"),
crunchBetween(birthyr, 1980, 1990) ~ gender,
TRUE ~ Category(name = "Missed Q", missing = TRUE),
data = ds
),
caseWhenExpr(
between(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
between(ds$birthyr, 1980, 1990) ~ ds$gender,
crunchBetween(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
crunchBetween(ds$birthyr, 1980, 1990) ~ ds$gender,
TRUE ~ Category(name = "Missed Q", missing = TRUE)
)
)
Expand All @@ -94,15 +94,15 @@ with_mock_crunch({
test_that("makeCaseWhenVariable handles data argument", {
expect_equal(
makeCaseWhenVariable(
between(birthyr, 1970, 1980) ~ Category(name = "Hello"),
between(birthyr, 1980, 1990) ~ gender,
crunchBetween(birthyr, 1970, 1980) ~ Category(name = "Hello"),
crunchBetween(birthyr, 1980, 1990) ~ gender,
TRUE ~ Category(name = "Missed Q", missing = TRUE),
data = ds,
name = "test"
),
makeCaseWhenVariable(
between(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
between(ds$birthyr, 1980, 1990) ~ ds$gender,
crunchBetween(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
crunchBetween(ds$birthyr, 1980, 1990) ~ ds$gender,
TRUE ~ Category(name = "Missed Q", missing = TRUE),
name = "test"
)
Expand All @@ -112,16 +112,16 @@ with_mock_crunch({
test_that("makeCaseWhenVariable correctly separates dots", {
expect_equal(
makeCaseWhenVariable(
between(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
between(ds$birthyr, 1980, 1990) ~ ds$gender,
crunchBetween(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
crunchBetween(ds$birthyr, 1980, 1990) ~ ds$gender,
TRUE ~ Category(name = "Missed Q", missing = TRUE),
name = "test",
description = "desc"
),
VarDef(
caseWhenExpr(
between(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
between(ds$birthyr, 1980, 1990) ~ ds$gender,
crunchBetween(ds$birthyr, 1970, 1980) ~ Category(name = "Hello"),
crunchBetween(ds$birthyr, 1980, 1990) ~ ds$gender,
TRUE ~ Category(name = "Missed Q", missing = TRUE)
),
name = "test",
Expand Down

2 comments on commit c1833c1

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests/testthat/test-case-when-variable.R:18:17: style: Only use double-quotes.

'}}}]}'
                ^~~~~~~

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests/testthat/test-case-when-variable.R:18:17: style: Only use double-quotes.

'}}}]}'
                ^~~~~~~

Please sign in to comment.