feat(data,text,testing): implement VL-002 TOML, VL-008 StrictJson UTF-8, VL-009 native tests, and VL-013 Semver shorthands
This commit is contained in:
1 parent
53d42bda42
commit
adfc8548dc
11 files changed
+2888
-28
No files matched your search
@@ -0,0 +1,46 @@
|
||||
#include <Void/Testing/Assert.hpp>
|
||||
#include <Void/Testing/Detail/Registry.hpp>
|
||||
#include <Void/Testing/Test.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace void_testing_native_test
|
||||
{
|
||||
struct CounterFixture {
|
||||
int value{0};
|
||||
void setup() { value = 41; }
|
||||
void teardown() { value = 0; }
|
||||
};
|
||||
} // namespace void_testing_native_test
|
||||
|
||||
VOID_TEST(NativeApi, self_registers_free_test)
|
||||
{
|
||||
Void::Testing::expect_eq(2 + 3, 5);
|
||||
}
|
||||
|
||||
VOID_TEST_TAGGED(NativeApi, tagged_native_test, "fast", "native")
|
||||
{
|
||||
const auto& tests = Void::Testing::Detail::Registry::instance().tests();
|
||||
bool found = false;
|
||||
for (const auto& t : tests) {
|
||||
if (t.suite == "NativeApi" && t.name == "tagged_native_test") {
|
||||
found = (t.tags.size() == 2U && t.tags[0] == "fast" &&
|
||||
t.tags[1] == "native");
|
||||
break;
|
||||
}
|
||||
}
|
||||
Void::Testing::expect(found);
|
||||
}
|
||||
|
||||
VOID_TEST_DISABLED(NativeApi, disabled_native_test, "intentional skip check")
|
||||
{
|
||||
Void::Testing::expect(false);
|
||||
}
|
||||
|
||||
VOID_TEST_FIXTURE(void_testing_native_test::CounterFixture,
|
||||
fixture_runs_setup_hook)
|
||||
{
|
||||
Void::Testing::expect_eq(fixture.value, 41);
|
||||
fixture.value += 1;
|
||||
Void::Testing::expect_eq(fixture.value, 42);
|
||||
}
|
||||
Reference in new issue
Block a user