aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/tests')
-rw-r--r--searchlib/src/tests/memoryindex/datastore/word_store_test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/searchlib/src/tests/memoryindex/datastore/word_store_test.cpp b/searchlib/src/tests/memoryindex/datastore/word_store_test.cpp
index 1de7b4a3efd..5c2bf0d634f 100644
--- a/searchlib/src/tests/memoryindex/datastore/word_store_test.cpp
+++ b/searchlib/src/tests/memoryindex/datastore/word_store_test.cpp
@@ -1,6 +1,8 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/searchlib/memoryindex/word_store.h>
#include <vespa/vespalib/gtest/gtest.h>
+#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/vespalib/util/size_literals.h>
#include <vespa/log/log.h>
LOG_SETUP("word_store_test");
@@ -64,6 +66,13 @@ TEST(WordStoreTest, add_word_triggers_change_of_buffer)
EXPECT_EQ(4u, lastId);
}
+TEST(WordStoreTest, long_word_triggers_exception)
+{
+ WordStore ws;
+ vespalib::string word(16_Mi + 1_Ki, 'z');
+ EXPECT_THROW(ws.addWord(word), vespalib::OverflowException);
+}
+
}
GTEST_MAIN_RUN_ALL_TESTS()