-
Notifications
You must be signed in to change notification settings - Fork 86
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
1 parent
190b721
commit be0d409
Showing
7 changed files
with
47 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
add_kuzu_test(main_test | ||
capi_test.cpp | ||
config_test.cpp | ||
connection_test.cpp | ||
csv_output_test.cpp | ||
|
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,25 @@ | ||
#include "graph_test/graph_test.h" | ||
|
||
using namespace kuzu::testing; | ||
|
||
class CApiTest : public BaseGraphTest { | ||
public: | ||
void SetUp() override { | ||
BaseGraphTest::SetUp(); | ||
const char* dbPath = databasePath.c_str(); | ||
database = std::make_unique<Database>(dbPath, *systemConfig); | ||
conn = std::make_unique<Connection>(database.get()); | ||
initGraph(); | ||
} | ||
|
||
std::string getInputDir() override { | ||
return TestHelper::appendKuzuRootPath("dataset/tinysnb/"); | ||
} | ||
}; | ||
|
||
TEST_F(CApiTest, Basic) { | ||
char query[] = "MATCH (a:person) RETURN COUNT(*)"; | ||
auto result = conn->kuzu_query(query); | ||
auto groundTruth = std::vector<std::string>{"8"}; | ||
ASSERT_EQ(TestHelper::convertResultToString(*result), groundTruth); | ||
} |