summaryrefslogtreecommitdiff
path: root/decoder/dict_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/dict_test.cc')
-rw-r--r--decoder/dict_test.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/decoder/dict_test.cc b/decoder/dict_test.cc
index 5c5d84f0..2049ec27 100644
--- a/decoder/dict_test.cc
+++ b/decoder/dict_test.cc
@@ -1,8 +1,13 @@
#include "dict.h"
+#include "fdict.h"
+
+#include <iostream>
#include <gtest/gtest.h>
#include <cassert>
+using namespace std;
+
class DTest : public testing::Test {
public:
DTest() {}
@@ -23,6 +28,18 @@ TEST_F(DTest, Convert) {
EXPECT_EQ(d.Convert(b), "bar");
}
+TEST_F(DTest, FDictTest) {
+ int fid = FD::Convert("First");
+ EXPECT_GT(fid, 0);
+ EXPECT_EQ(FD::Convert(fid), "First");
+ string x = FD::Escape("=");
+ cerr << x << endl;
+ EXPECT_NE(x, "=");
+ x = FD::Escape(";");
+ cerr << x << endl;
+ EXPECT_NE(x, ";");
+}
+
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();