-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a0b70b
commit 57ab6e5
Showing
6 changed files
with
47 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -23,4 +23,7 @@ RoxygenNote: 7.2.1 | |
Imports: | ||
pkgload | ||
Suggests: | ||
testthat, | ||
xml2 | ||
LinkingTo: | ||
testthat |
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,6 @@ | ||
# This dummy function definition is included with the package to ensure that | ||
# 'tools::package_native_routine_registration_skeleton()' generates the required | ||
# registration info for the 'run_testthat_tests' symbol. | ||
(function() { | ||
.Call("run_testthat_tests", FALSE, PACKAGE = "sxpdb") | ||
}) |
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,7 @@ | ||
/* | ||
* Please do not edit this file -- it ensures that your package will export a | ||
* 'run_testthat_tests()' C routine that can be used to run the Catch unit tests | ||
* available in your package. | ||
*/ | ||
#define TESTTHAT_TEST_RUNNER | ||
#include <testthat.h> |
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,26 @@ | ||
/* | ||
* This file uses the Catch unit testing library, alongside | ||
* testthat's simple bindings, to test a C++ function. | ||
* | ||
* For your own packages, ensure that your test files are | ||
* placed within the `src/` folder, and that you include | ||
* `LinkingTo: testthat` within your DESCRIPTION file. | ||
*/ | ||
|
||
// All test files should include the <testthat.h> | ||
// header file. | ||
#include <testthat.h> | ||
#include "search_index.h" | ||
|
||
|
||
context("Index tests") { | ||
|
||
test_that("find_na on sexp_view") { | ||
Serializer ser(64); | ||
|
||
const sexp_view_t sexp_view = Serializer::unserialize_view(ser.serialize(Rf_ScalarReal(NA_REAL))); | ||
|
||
expect_true(find_na(sexp_view)); | ||
} | ||
|
||
} |
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 @@ | ||
run_cpp_tests("sxpdb") |