From 16818c0d69a86b25320af86bb4a7087103f06b5e Mon Sep 17 00:00:00 2001 From: wyy Date: Sun, 6 Oct 2013 02:25:05 -0700 Subject: [PATCH] init test for unitest --- cppjieba/ChineseFilter.h | 1 - test/ChineseFilterUt.cpp | 26 +++++++++++++++++++ test/Makefile | 54 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 test/ChineseFilterUt.cpp create mode 100644 test/Makefile diff --git a/cppjieba/ChineseFilter.h b/cppjieba/ChineseFilter.h index e5256af..77823be 100644 --- a/cppjieba/ChineseFilter.h +++ b/cppjieba/ChineseFilter.h @@ -11,7 +11,6 @@ namespace CppJieba class ChFilterIterator { - public: public: const Unicode * ptUnico; UniConIter begin; diff --git a/test/ChineseFilterUt.cpp b/test/ChineseFilterUt.cpp new file mode 100644 index 0000000..eb06c8f --- /dev/null +++ b/test/ChineseFilterUt.cpp @@ -0,0 +1,26 @@ +#include + +#ifdef UT +using namespace CppJieba; + + +int main(int argc, char** argv) +{ + ChineseFilter chFilter; + ifstream ifs("../demo/testlines.utf8"); + string line; + while(getline(ifs, line)) + { + chFilter.feed(line); + for(ChineseFilter::iterator it = chFilter.begin(); it != chFilter.end(); it++) + { + //cout<<__FILE__<<__LINE__< $@.$$$$; \ + sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ + rm -f $@.$$$$