Skip to content

Commit 18f0a95

Browse files
Fixed minor issues in the tests
1 parent 5b5b17f commit 18f0a95

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

tests/generic/test_optional.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1+
#include <gtest/gtest.h>
2+
13
#include <rfl.hpp>
24
#include <string>
3-
#include <gtest/gtest.h>
45

56
namespace test_optional {
67

78
struct Person {
8-
std::string name;
9-
std::optional<rfl::Box<Person>> spouse;
9+
std::string name;
10+
std::optional<rfl::Box<Person>> spouse;
1011
};
1112

1213
TEST(generic, test_optional) {
13-
rfl::Generic generic;
14-
// This failed to compile due to optional copying rather than moving
15-
rfl::from_generic<Person>(generic);
14+
rfl::Generic generic;
15+
// This failed to compile due to optional copying rather than moving
16+
rfl::from_generic<Person>(generic).value();
1617
}
17-
} // namespace test_map
18+
} // namespace test_optional

tests/json/test_save_load.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
#include <gtest/gtest.h>
2+
13
#include <cassert>
24
#include <iostream>
35
#include <rfl.hpp>
46
#include <rfl/json.hpp>
57
#include <string>
68
#include <vector>
79

8-
#include <gtest/gtest.h>
9-
1010
namespace test_save_load {
1111

1212
using Age = rfl::Validator<unsigned int,
@@ -49,14 +49,15 @@ TEST(json, test_save_load) {
4949
.email = "homer@simpson.com",
5050
.children = std::vector<Person>({bart, lisa, maggie})};
5151

52-
rfl::json::save("homer.json", homer1);
52+
rfl::json::save("homer.json", homer1).value();
5353

5454
const auto homer2 = rfl::json::load<Person>("homer.json").value();
5555

5656
const auto string1 = rfl::json::write(homer1);
5757
const auto string2 = rfl::json::write(homer2);
5858

59-
EXPECT_EQ(string1, string2) << "Test failed. Content was not identical." << std::endl
60-
<< std::endl;
59+
EXPECT_EQ(string1, string2)
60+
<< "Test failed. Content was not identical." << std::endl
61+
<< std::endl;
6162
}
6263
} // namespace test_save_load

0 commit comments

Comments
 (0)