-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix find_last_of when char isn't found (#49)
resolves #48
- Loading branch information
1 parent
d073770
commit 36ce015
Showing
3 changed files
with
41 additions
and
3 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
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,34 @@ | ||
#include <cib/cib.hpp> | ||
|
||
#include <catch2/catch_test_macros.hpp> | ||
|
||
#include <cstdio> | ||
|
||
struct say_message : public cib::callback_meta<>{}; | ||
|
||
// the 'core' component exposes the 'say_message' service for others to extend | ||
struct core { | ||
constexpr static auto config = cib::exports<say_message>; | ||
}; | ||
|
||
// the 'say_hello_world' component extends 'say_message' with its own functionality | ||
struct say_hello_world { | ||
constexpr static auto config = | ||
cib::extend<say_message>([](){ | ||
puts("Hello, world!\n"); | ||
}); | ||
}; | ||
|
||
// the 'hello_world' project composes 'core' and 'say_hello_world' | ||
struct hello_world { | ||
constexpr static auto config = | ||
cib::components<core, say_hello_world>; | ||
}; | ||
|
||
// the nexus instantiates the project | ||
cib::nexus<hello_world> nexus{}; | ||
|
||
|
||
TEST_CASE("make sure the simple hello world example compiles") { | ||
nexus.service<say_message>(); | ||
} |