Skip to content

Commit 575ada9

Browse files
committed
Add first rytest components
1 parent 82019c0 commit 575ada9

File tree

7 files changed

+87
-0
lines changed

7 files changed

+87
-0
lines changed

include/rvstd/context.hpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef RVSTD_CONTEXT_HPP
2+
#define RVSTD_CONTEXT_HPP
3+
4+
#include "rvstd/tableau.hpp"
5+
6+
namespace rvstd {
7+
8+
struct context {
9+
context();
10+
context(context const& ctx) = delete;
11+
context(context&& ctx) noexcept = delete;
12+
auto operator=(context const& ctx) -> context& = delete;
13+
auto operator=(context&& ctx) noexcept -> context& = delete;
14+
~context();
15+
16+
public:
17+
tableau data;
18+
};
19+
20+
} // namespace rvstd
21+
22+
#endif

include/rvstd/parser.hpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef RVSTD_PARSER_HPP
2+
#define RVSTD_PARSER_HPP
3+
4+
#include "rvstd/unique_identifier.hpp"
5+
6+
#include <boost/url/parse.hpp>
7+
#include <boost/url/urls.hpp>
8+
9+
namespace rvstd {
10+
11+
auto parse_uri(boost::core::string_view s) -> unique_identifier
12+
{
13+
boost::system::result<boost::url_view> r = boost::urls::parse_uri(s);
14+
15+
return {};
16+
}
17+
18+
auto parse_expression(string_view sv) -> unique_identifier;
19+
20+
} // namespace rvstd
21+
22+
#endif // RVSTD_PARSER_HPP

include/rvstd/property.hpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#ifndef RVSTD_PROPERTY_HPP
2+
#define RVSTD_PROPERTY_HPP
3+
4+
namespace rvstd {
5+
6+
struct property {
7+
property() = default;
8+
property(property const& prop) = delete;
9+
property(property&& prop) noexcept = delete;
10+
auto operator=(property const& prop) -> property& = delete;
11+
auto operator=(property&& prop) noexcept -> property& = delete;
12+
~property() = default;
13+
14+
public:
15+
int value;
16+
};
17+
18+
} // namespace rvstd
19+
20+
#endif

src/rvstd/context.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include "rvstd/context.hpp"
2+
3+
namespace rvstd {
4+
5+
rvstd::context::context() = default;
6+
rvstd::context::~context() = default;
7+
8+
} // namespace rvstd

src/rvstd/parser.cpp

Whitespace-only changes.

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ include(CTest)
66
add_executable(
77
rvstd_tests
88
options.test.cpp
9+
parser.test.cpp
910
resource.test.cpp
1011
tableau.test.cpp
1112
unique_identifier.test.cpp

tests/parser.test.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
#include <boost/url.hpp>
3+
#include <catch2/catch_test_macros.hpp>
4+
5+
TEST_CASE("URL")
6+
{
7+
boost::urls::url u("#/d/e/f");
8+
9+
REQUIRE(u.encoded_host().empty());
10+
REQUIRE(u.encoded_path().empty());
11+
REQUIRE(u.encoded_query().empty());
12+
REQUIRE(u.encoded_fragment() == "/d/e/f");
13+
REQUIRE(u.encoded_userinfo().empty());
14+
}

0 commit comments

Comments
 (0)