Skip to content

Commit c14131e

Browse files
committed
refactor: clean up load_test.cpp by removing unused dependencies and tests
- Removed unused Jieba test and associated includes from load_test.cpp. - Simplified main function to focus on essential operations. - Ensured consistent exit handling by returning EXIT_SUCCESS.
1 parent 9cd64a1 commit c14131e

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

test/load_test.cpp

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#include "cppjieba/MixSegment.hpp"
77
#include "cppjieba/KeywordExtractor.hpp"
88
#include "limonp/Colors.hpp"
9-
#include "cppjieba/Jieba.hpp"
10-
#include "gtest/gtest.h"
119
#include "test_paths.h"
1210

1311
using namespace cppjieba;
@@ -53,24 +51,8 @@ void Extract(size_t times = 400) {
5351
ColorPrintln(GREEN, "Extract: [%.3lf seconds]time consumed.", double(endTime - beginTime)/CLOCKS_PER_SEC);
5452
}
5553

56-
TEST(LoadTest, Test1) {
57-
Jieba jieba(DICT_DIR "/jieba.dict.utf8",
58-
DICT_DIR "/hmm_model.utf8",
59-
DICT_DIR "/user.dict.utf8",
60-
DICT_DIR "/idf.utf8",
61-
DICT_DIR "/stop_words.utf8");
62-
vector<string> words;
63-
string result;
64-
65-
jieba.Cut("他来到了网易杭研大厦", words);
66-
result << words;
67-
string expected = "[\"\", \"来到\", \"\", \"网易\", \"杭研\", \"大厦\"]";
68-
ASSERT_EQ(expected, result);
69-
}
70-
71-
int main(int argc, char** argv) {
72-
testing::InitGoogleTest(&argc, argv);
54+
int main(int argc, char ** argv) {
7355
Cut();
7456
Extract();
75-
return RUN_ALL_TESTS();
76-
}
57+
return EXIT_SUCCESS;
58+
}

0 commit comments

Comments
 (0)