From e2451126983e00f04535887e9ba0b359a7d2df90 Mon Sep 17 00:00:00 2001 From: Johannes Kalmbach Date: Fri, 24 Jan 2025 15:53:30 +0100 Subject: [PATCH] Fix a small but dramatic bug. Signed-off-by: Johannes Kalmbach --- src/parser/TripleComponent.cpp | 4 ++++ test/TripleComponentTest.cpp | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/parser/TripleComponent.cpp b/src/parser/TripleComponent.cpp index 96730aa0b4..e6913c17a1 100644 --- a/src/parser/TripleComponent.cpp +++ b/src/parser/TripleComponent.cpp @@ -28,7 +28,11 @@ std::ostream& operator<<(std::ostream& stream, const TripleComponent& obj) { stream << "DATE: " << value.toStringAndType().first; } else if constexpr (std::is_same_v) { stream << (value ? "true" : "false"); + } else if constexpr (std::is_same_v) { + stream << Id::makeFromGeoPoint(value); } else { + static_assert( + ad_utility::SameAsAny); stream << value; } }, diff --git a/test/TripleComponentTest.cpp b/test/TripleComponentTest.cpp index 2c67b16823..ec6e1f19f7 100644 --- a/test/TripleComponentTest.cpp +++ b/test/TripleComponentTest.cpp @@ -3,7 +3,7 @@ // Author: Johannes Kalmbach(joka921) // -#include +#include #include "./util/IdTestHelpers.h" #include "./util/TripleComponentTestHelpers.h" @@ -225,3 +225,16 @@ TEST(TripleComponent, invalidDatatypeForLiteral) { // Something that is invalid because it is none of the above ASSERT_ANY_THROW(lit("\"alpha\"", "fr-ca")); } + +/* +TEST(TripleComponent, toString) { + using Tc = TripleComponent; + auto match = [](const std::string& s) { + .. Todo... + + } + EXPECT_EQ({GeoPoint{13, 14}}; + EXPECT_EQ() + +} +*/