-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from JohanMabille/upgrade
Added tests
- Loading branch information
Showing
6 changed files
with
73 additions
and
27 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
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ dependencies: | |
- ninja | ||
# host Dependencies | ||
- xvega=0.1.0 | ||
- nlohmann_json=3.11.3 | ||
# Test dependencies | ||
- doctest | ||
|
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,30 @@ | ||
/*************************************************************************** | ||
* Copyright (c) 2024, QuantStack and xeus-SQLite contributors * | ||
* * | ||
* Distributed under the terms of the BSD 3-Clause License. * | ||
* * | ||
* The full license is in the file LICENSE, distributed with this software. * | ||
****************************************************************************/ | ||
|
||
#include "doctest/doctest.h" | ||
|
||
#include "xvega-bindings/xvega_bindings.hpp" | ||
|
||
TEST_SUITE("xvega-bindings") | ||
{ | ||
TEST_CASE("sanitize_string_check") | ||
{ | ||
std::string code = "\n\n Some inp\nut\n"; | ||
std::string sanitized_string; | ||
sanitized_string = xv_bindings::sanitize_string(code); | ||
CHECK_EQ(sanitized_string, " Some input"); | ||
} | ||
|
||
TEST_CASE("tokenizer_check") | ||
{ | ||
std::string code = "%LOAD database.db rw"; | ||
std::vector<std::string> tokenized_code; | ||
tokenized_code = xv_bindings::tokenizer(code); | ||
CHECK_EQ(tokenized_code[1], "database.db"); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -21,6 +21,7 @@ include(CMakeFindDependencyMacro) | |
# nlohmann_json requires libraries that exchange json objects to be linked | ||
# with the same version of nlohmann_json. | ||
find_dependency(xvega) | ||
find_dependency(nlohmann_json @nlohmann_json_VERSION@ EXACT) | ||
|
||
if(NOT TARGET @PROJECT_NAME@) | ||
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
|