-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More informative messages when
fail_if(cond = )
is invalid (#341)
- Loading branch information
1 parent
2ef6caa
commit 02f23cd
Showing
5 changed files
with
151 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Type: Package | ||
Package: gradethis | ||
Title: Automated Feedback for Student Exercises in 'learnr' Tutorials | ||
Version: 0.2.12.9000 | ||
Version: 0.2.12.9001 | ||
Authors@R: c( | ||
person("Garrick", "Aden-Buie", , "[email protected]", role = "aut", | ||
comment = c(ORCID = "0000-0002-7111-0077")), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# pass_if() and fail_if() give errors for invalid cond | ||
|
||
Code | ||
grade <- expect_grade_this(pass_if(~TRUE), user_code = "1", solution_code = "2", | ||
is_correct = logical(0)) | ||
Warning <simpleWarning> | ||
The `cond` argument to `pass_if()` does not accept functions or formulas when used inside `grade_this()`. | ||
|
||
--- | ||
|
||
Code | ||
grade <- expect_grade_this(fail_if(~TRUE), user_code = "1", solution_code = "2", | ||
is_correct = logical(0)) | ||
Warning <simpleWarning> | ||
The `cond` argument to `fail_if()` does not accept functions or formulas when used inside `grade_this()`. | ||
|
||
--- | ||
|
||
Code | ||
grade <- expect_grade_this(pass_if(all.equal(.result, .solution)), user_code = "1", | ||
solution_code = "2", is_correct = logical(0)) | ||
Warning <simpleWarning> | ||
The `cond` argument to `pass_if()` must be coercible to logical, not an object of class <character>. | ||
|
||
--- | ||
|
||
Code | ||
grade <- expect_grade_this(fail_if(!all.equal(.result, .solution)), user_code = "1", | ||
solution_code = "2", is_correct = logical(0)) | ||
Warning <simpleWarning> | ||
The `cond` argument to `fail_if()` produced an error: | ||
Error in !all.equal(.result, .solution) : invalid argument type | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters