ChaiScript / ChaiScript
Showing 1 of 1 files from the diff.

@@ -50,6 +50,26 @@
Loading
50 50
  CHECK(chai.eval<std::string>("f2()") == "world");
51 51
}
52 52
53 +
TEST_CASE("Lambdas can return boolean")
54 +
{
55 +
  chaiscript::ChaiScript_Basic chai(create_chaiscript_stdlib(),create_chaiscript_parser());
56 +
57 +
  // check lambdas returning bool from chaiscript:
58 +
  std::function<bool ()> chai_function;
59 +
60 +
  CHECK_NOTHROW(chai_function = chai.eval<std::function<bool ()>>("fun() { 42 != 0 }"));
61 +
62 +
  bool result = false;
63 +
  CHECK_NOTHROW(result = chai_function());
64 +
65 +
  CHECK(result == true);
66 +
67 +
  // check lambdas returning bool from C++:
68 +
  auto cpp_function = [](int x) { return x == 42; };
69 +
  CHECK_NOTHROW(chai.add(chaiscript::fun(cpp_function), "cpp_function"));
70 +
  CHECK_NOTHROW(result = chai.eval<bool>("cpp_function(314)"));
71 +
  CHECK(result == false);
72 +
}
53 73
54 74
// dynamic_object tests
55 75
TEST_CASE("Dynamic_Object attributes can be shared with C++")
Files Coverage
include/chaiscript 90.93%
src 72.79%
static_libs 100.00%
unittests 46.10%
Project Totals (60 files) 69.82%
Notifications are pending CI completion. Waiting for GitHub's status webhook to queue notifications. Push notifications now.
1178.3
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading