ModErn Text Analysis
META Enumerates Textual Applications
string_list_test.h
Go to the documentation of this file.
1 
10 #ifndef META_STRING_LIST_TEST_H_
11 #define META_STRING_LIST_TEST_H_
12 
13 #include <cstring>
14 #include <fstream>
15 
16 #include "test/unit_test.h"
17 #include "io/binary.h"
18 #include "index/string_list.h"
20 #include "util/filesystem.h"
21 
22 #include "unit_test.h"
23 
24 namespace meta
25 {
26 namespace testing
27 {
32 void assert_read(std::ifstream& file, const std::string& expect);
33 
37 struct file_guard
38 {
42  file_guard(const std::string& path) : path_{path}
43  {
44  filesystem::delete_file(path_);
45  }
46 
52  {
53  filesystem::delete_file(path_);
54  }
56  const std::string& path_;
57 };
58 
63 int string_list_tests();
64 }
65 }
66 
67 #endif
int string_list_tests()
Runs the string list tests.
Definition: string_list_test.cpp:20
~file_guard()
Always makes sure that the file is deleted when the object's destructor is called.
Definition: string_list_test.h:51
file_guard(const std::string &path)
Always makes sure that a new file is created.
Definition: string_list_test.h:42
const std::string & path_
The path to this file.
Definition: string_list_test.h:56
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition: analyzer.h:24
Always makes sure a new file is created.
Definition: string_list_test.h:37
void assert_read(std::ifstream &file, const std::string &expect)
Definition: string_list_test.cpp:13