Skip to content

Commit

Permalink
Add basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTF committed Feb 3, 2025
1 parent 85289a2 commit 1b2ff88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/engine/sparqlExpressions/ConvertToNumericExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#include "engine/sparqlExpressions/NaryExpressionImpl.h"

namespace sparqlExpression {
namespace detail::string_expressions {
class StrExpressionImpl;
}
namespace detail::to_numeric {

// class that converts an input `int64_t`, `double` or `std::string`
Expand Down
7 changes: 7 additions & 0 deletions test/SparqlAntlrParserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1798,8 +1798,15 @@ TEST(SparqlParser, FunctionCall) {
matchUnary(&makeConvertToIntExpression));
expectFunctionCall(absl::StrCat(xsd, "double>(?x)"),
matchUnary(&makeConvertToDoubleExpression));
expectFunctionCall(absl::StrCat(xsd, "float>(?x)"),
matchUnary(&makeConvertToDoubleExpression));
expectFunctionCall(absl::StrCat(xsd, "decimal>(?x)"),
matchUnary(&makeConvertToDecimalExpression));
expectFunctionCall(absl::StrCat(xsd, "boolean>(?x)"),
matchUnary(&makeConvertToBooleanExpression));

expectFunctionCall(absl::StrCat(xsd, "string>(?x)"),
matchUnary(&makeConvertToStringExpression));

// Wrong number of arguments.
expectFunctionCallFails(absl::StrCat(geof, "distance>(?a)"));
Expand Down

0 comments on commit 1b2ff88

Please sign in to comment.