Running 'testthat.R' [9s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(magrittr)
  
  Attaching package: 'magrittr'
  
  The following objects are masked from 'package:testthat':
  
      equals, is_less_than, not
  
  > test_check("ompr")
  Loading required package: ompr
  -- ERROR (test-add-constraint.R:15:3): constraints should be saved with only + o
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-add-constraint.R:15:2
    2. +-ompr::set_objective(., 5/(-x + y), sense = "max")
    3. | \-ompr::set_objective_(...)
    4. \-ompr::add_constraint(., x - y <= 10)
    5.   +-ompr::add_constraint_(...)
    6.   \-ompr:::add_constraint_.optimization_model(...)
    7.     \-ompr:::add_constraint_internal()
    8.       \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.         \-ompr:::bind_variables(model, expression, envir)
   10.           \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-add-constraint.R:23:3): constraints can have an unary + operator 
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-add-constraint.R:23:2
    2. +-ompr::set_objective(., 5/(-x + y), sense = "max")
    3. | \-ompr::set_objective_(...)
    4. \-ompr::add_constraint(., +x - y <= 10)
    5.   +-ompr::add_constraint_(...)
    6.   \-ompr:::add_constraint_.optimization_model(...)
    7.     \-ompr:::add_constraint_internal()
    8.       \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.         \-ompr:::bind_variables(model, expression, envir)
   10.           \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-helpers.R:73:3): bug 20161107 #103: bug in extract coefficient (2
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-helpers.R:73:2
    2. \-ompr::add_constraint(., y - a * x[i] <= 1, i = 1:2)
    3.   +-ompr::add_constraint_(...)
    4.   \-ompr:::add_constraint_.optimization_model(...)
    5.     \-base::apply(...)
    6.       \-ompr:::FUN(newX[, i], ...)
    7.         \-ompr:::add_constraint_internal(calling_env)
    8.           \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.             \-ompr:::bind_variables(model, expression, envir)
   10.               \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-helpers.R:82:3): sum_expr returns 0 if filter expression yields 0
  Error: first argument has length > 1
  Backtrace:
      x
   1. +-`%>%`(...) test-helpers.R:82:2
   2. \-ompr::add_constraint(., sum_expr(x[i], i = 1:2, i == 23) == 1)
   3.   +-ompr::add_constraint_(...)
   4.   \-ompr:::add_constraint_.optimization_model(...)
   5.     \-ompr:::add_constraint_internal()
   6.       \-ompr:::normalize_expression(model, lhs_ast, envir)
   7.         \-ompr:::bind_variables(model, expression, envir)
   8.           \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-model-api.R:100:5): extract_constraints(): returns a list of name
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-model-api.R:100:4
    2. \-ompr::add_constraint(., x[i] + y[i] <= 1, i = 1:3)
    3.   +-ompr::add_constraint_(...)
    4.   \-ompr:::add_constraint_.optimization_model(...)
    5.     \-base::apply(...)
    6.       \-ompr:::FUN(newX[, i], ...)
    7.         \-ompr:::add_constraint_internal(calling_env)
    8.           \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.             \-ompr:::bind_variables(model, expression, envir)
   10.               \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-model-api.R:109:5): extract_constraints(): returns the constraint
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-model-api.R:109:4
    2. \-ompr::add_constraint(., x[i] + y[i] <= 1, i = 1:3)
    3.   +-ompr::add_constraint_(...)
    4.   \-ompr:::add_constraint_.optimization_model(...)
    5.     \-base::apply(...)
    6.       \-ompr:::FUN(newX[, i], ...)
    7.         \-ompr:::add_constraint_internal(calling_env)
    8.           \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.             \-ompr:::bind_variables(model, expression, envir)
   10.               \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-model-api.R:119:5): extract_constraints(): returns the constraint
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-model-api.R:119:4
    2. \-ompr::add_constraint(., x[i] + y[i] <= 1, i = 1:3)
    3.   +-ompr::add_constraint_(...)
    4.   \-ompr:::add_constraint_.optimization_model(...)
    5.     \-base::apply(...)
    6.       \-ompr:::FUN(newX[, i], ...)
    7.         \-ompr:::add_constraint_internal(calling_env)
    8.           \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.             \-ompr:::bind_variables(model, expression, envir)
   10.               \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-model-api.R:127:5): extract_constraints(): returns the constraint
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-model-api.R:127:4
    2. \-ompr::add_constraint(., x[i] + y[i] <= 1, i = 1:3)
    3.   +-ompr::add_constraint_(...)
    4.   \-ompr:::add_constraint_.optimization_model(...)
    5.     \-base::apply(...)
    6.       \-ompr:::FUN(newX[, i], ...)
    7.         \-ompr:::add_constraint_internal(calling_env)
    8.           \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.             \-ompr:::bind_variables(model, expression, envir)
   10.               \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-model-api.R:135:5): extract_constraints(): returns a sparse Matri
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-model-api.R:135:4
    2. \-ompr::add_constraint(., x[i] + y[i] <= 1, i = 1:3)
    3.   +-ompr::add_constraint_(...)
    4.   \-ompr:::add_constraint_.optimization_model(...)
    5.     \-base::apply(...)
    6.       \-ompr:::FUN(newX[, i], ...)
    7.         \-ompr:::add_constraint_internal(calling_env)
    8.           \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.             \-ompr:::bind_variables(model, expression, envir)
   10.               \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-model-api.R:211:5): variable_bounds(): returns the bounds in the 
  Error: first argument has length > 1
  Backtrace:
      x
   1. +-`%>%`(...) test-model-api.R:211:4
   2. +-ompr::add_constraint(...)
   3. | \-ompr::add_constraint_(...)
   4. \-ompr::set_objective(., 0)
   5.   +-ompr::set_objective_(...)
   6.   \-ompr:::set_objective_.optimization_model(...)
   7.     \-ompr:::normalize_expression(model, obj_ast, expression$env)
   8.       \-ompr:::bind_variables(model, expression, envir)
   9.         \-base::exists(names(model$variables), calling_env)
  
  -- Skip (test-model-milp.R:141:3): small to mid sized models should work -------
  Reason: On CRAN
  
  -- Skip (test-model-milp.R:156:3): small to mid sized model should work #2 -----
  Reason: On CRAN
  
  -- ERROR (test-model.R:78:3): bug 20160701: -x as a formula --------------------
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-testthat::expect_silent(...) test-model.R:78:2
    2. | \-testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    3. |   +-testthat:::.capture(...)
    4. |   | +-withr::with_output_sink(...)
    5. |   | | \-base::force(code)
    6. |   | +-base::withCallingHandlers(...)
    7. |   | \-base::withVisible(code)
    8. |   \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    9. +-`%>%`(...)
   10. +-ompr::set_objective(., -x + y, sense = "max")
   11. | \-ompr::set_objective_(...)
   12. \-ompr::add_constraint(., x + y <= 10)
   13.   +-ompr::add_constraint_(...)
   14.   \-ompr:::add_constraint_.optimization_model(...)
   15.     \-ompr:::add_constraint_internal()
   16.       \-ompr:::normalize_expression(model, lhs_ast, envir)
   17.         \-ompr:::bind_variables(model, expression, envir)
   18.           \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-model.R:85:3): model has a nice default output ------------------
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-model.R:85:2
    2. +-ompr::set_objective(., -x + y, sense = "max")
    3. | \-ompr::set_objective_(...)
    4. \-ompr::add_constraint(., x + y <= 10)
    5.   +-ompr::add_constraint_(...)
    6.   \-ompr:::add_constraint_.optimization_model(...)
    7.     \-ompr:::add_constraint_internal()
    8.       \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.         \-ompr:::bind_variables(model, expression, envir)
   10.           \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-model.R:109:3): multiplications in objective fun ----------------
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-model.R:109:2
    2. +-ompr::set_objective(., 5 * (-x + y), sense = "max")
    3. | \-ompr::set_objective_(...)
    4. \-ompr::add_constraint(., x + y <= 10)
    5.   +-ompr::add_constraint_(...)
    6.   \-ompr:::add_constraint_.optimization_model(...)
    7.     \-ompr:::add_constraint_internal()
    8.       \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.         \-ompr:::bind_variables(model, expression, envir)
   10.           \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-model.R:122:3): devision in objective fun -----------------------
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-model.R:122:2
    2. +-ompr::set_objective(., 5/(-x + y), sense = "max")
    3. | \-ompr::set_objective_(...)
    4. \-ompr::add_constraint(., x + y <= 10)
    5.   +-ompr::add_constraint_(...)
    6.   \-ompr:::add_constraint_.optimization_model(...)
    7.     \-ompr:::add_constraint_internal()
    8.       \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.         \-ompr:::bind_variables(model, expression, envir)
   10.           \-base::exists(names(model$variables), calling_env)
  
  -- Skip (test-model.R:130:3): small to mid sized models should work ------------
  Reason: On CRAN
  
  -- Skip (test-model.R:145:3): small to mid sized model should work #2 ----------
  Reason: On CRAN
  
  -- ERROR (test-solution.R:4:2): export single var to numeric -------------------
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-solution.R:4:1
    2. +-ompr::set_objective(., x + y)
    3. | \-ompr::set_objective_(...)
    4. \-ompr::add_constraint(., x + y <= 1)
    5.   +-ompr::add_constraint_(...)
    6.   \-ompr:::add_constraint_.optimization_model(...)
    7.     \-ompr:::add_constraint_internal()
    8.       \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.         \-ompr:::bind_variables(model, expression, envir)
   10.           \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-solution.R:18:3): get_solution: fails if variable not present ---
  Error: first argument has length > 1
  Backtrace:
       x
    1. +-`%>%`(...) test-solution.R:18:2
    2. +-ompr::set_objective(., x + y)
    3. | \-ompr::set_objective_(...)
    4. \-ompr::add_constraint(., x + y <= 1)
    5.   +-ompr::add_constraint_(...)
    6.   \-ompr:::add_constraint_.optimization_model(...)
    7.     \-ompr:::add_constraint_internal()
    8.       \-ompr:::normalize_expression(model, lhs_ast, envir)
    9.         \-ompr:::bind_variables(model, expression, envir)
   10.           \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-solution.R:86:3): export solutions to single value if all indexes
  Error: first argument has length > 1
  Backtrace:
      x
   1. +-`%>%`(...) test-solution.R:86:2
   2. \-ompr::set_objective(., sum_expr(x[i], i = 1:3))
   3.   +-ompr::set_objective_(...)
   4.   \-ompr:::set_objective_.optimization_model(...)
   5.     \-ompr:::normalize_expression(model, obj_ast, expression$env)
   6.       \-ompr:::bind_variables(model, expression, envir)
   7.         \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-solution.R:101:3): export solutions to df in a model with more th
  Error: first argument has length > 1
  Backtrace:
      x
   1. +-`%>%`(...) test-solution.R:101:2
   2. \-ompr::set_objective(., sum_expr(x[i], i = 1:3))
   3.   +-ompr::set_objective_(...)
   4.   \-ompr:::set_objective_.optimization_model(...)
   5.     \-ompr:::normalize_expression(model, obj_ast, expression$env)
   6.       \-ompr:::bind_variables(model, expression, envir)
   7.         \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-solution.R:116:3): solution has a nice default output -----------
  Error: first argument has length > 1
  Backtrace:
      x
   1. +-`%>%`(...) test-solution.R:116:2
   2. \-ompr::set_objective(., sum_expr(x[i], i = 1:3))
   3.   +-ompr::set_objective_(...)
   4.   \-ompr:::set_objective_.optimization_model(...)
   5.     \-ompr:::normalize_expression(model, obj_ast, expression$env)
   6.       \-ompr:::bind_variables(model, expression, envir)
   7.         \-base::exists(names(model$variables), calling_env)
  
  -- ERROR (test-solution.R:131:3): solution indexes should not be factors -------
  Error: first argument has length > 1
  Backtrace:
      x
   1. +-`%>%`(...) test-solution.R:131:2
   2. \-ompr::set_objective(., sum_expr(x[i], i = 1:3))
   3.   +-ompr::set_objective_(...)
   4.   \-ompr:::set_objective_.optimization_model(...)
   5.     \-ompr:::normalize_expression(model, obj_ast, expression$env)
   6.       \-ompr:::bind_variables(model, expression, envir)
   7.         \-base::exists(names(model$variables), calling_env)
  
  -- Skipped tests  --------------------------------------------------------------
  * On CRAN (4)
  
  == testthat results  ===========================================================
  ERROR (test-add-constraint.R:15:3): constraints should be saved with only + operators
  ERROR (test-add-constraint.R:23:3): constraints can have an unary + operator
  ERROR (test-helpers.R:73:3): bug 20161107 #103: bug in extract coefficient (2)
  ERROR (test-helpers.R:82:3): sum_expr returns 0 if filter expression yields 0 variables
  ERROR (test-model-api.R:100:5): extract_constraints(): returns a list of named elements
  ERROR (test-model-api.R:109:5): extract_constraints(): returns the constraint matrix as a matrix
  ERROR (test-model-api.R:119:5): extract_constraints(): returns the constraint right hand side
  ERROR (test-model-api.R:127:5): extract_constraints(): returns the constraint sense
  ERROR (test-model-api.R:135:5): extract_constraints(): returns a sparse Matrix with column-oriented encoding
  ERROR (test-model-api.R:211:5): variable_bounds(): returns the bounds in the order of the constraint matrix
  ERROR (test-model.R:78:3): bug 20160701: -x as a formula
  ERROR (test-model.R:85:3): model has a nice default output
  ERROR (test-model.R:109:3): multiplications in objective fun
  ERROR (test-model.R:122:3): devision in objective fun
  ERROR (test-solution.R:4:2): export single var to numeric
  ERROR (test-solution.R:18:3): get_solution: fails if variable not present
  ERROR (test-solution.R:86:3): export solutions to single value if all indexes bound
  ERROR (test-solution.R:101:3): export solutions to df in a model with more than one variable
  ERROR (test-solution.R:116:3): solution has a nice default output
  ERROR (test-solution.R:131:3): solution indexes should not be factors
  
  [ FAIL 20 | WARN 0 | SKIP 4 | PASS 469 ]
  Error: Test failures
  Execution halted