-
-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
75 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
namespace sqlite_orm { | ||
namespace internal { | ||
struct rank_t {}; | ||
} | ||
|
||
inline internal::rank_t rank() { | ||
return {}; | ||
} | ||
} |
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
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,24 @@ | ||
#include <sqlite_orm/sqlite_orm.h> | ||
#include <catch2/catch_all.hpp> | ||
|
||
using namespace sqlite_orm; | ||
|
||
TEST_CASE("statement_serializer rank") { | ||
using db_objects_t = internal::db_objects_tuple<>; | ||
auto dbObjects = db_objects_t{}; | ||
using context_t = internal::serializer_context<db_objects_t>; | ||
context_t context{dbObjects}; | ||
std::string value; | ||
std::string expected; | ||
SECTION("rank") { | ||
auto node = rank(); | ||
value = serialize(node, context); | ||
expected = "rank"; | ||
} | ||
SECTION("order by rank") { | ||
auto node = order_by(rank()); | ||
value = serialize(node, context); | ||
expected = "ORDER BY rank"; | ||
} | ||
REQUIRE(value == expected); | ||
} |