From f155eaff4bd3029c294985560bf2575528380e9e Mon Sep 17 00:00:00 2001 From: Mo Morsi Date: Thu, 19 Mar 2020 12:46:40 -0400 Subject: [PATCH] Unit test for memo --- src/test/jtx/Env_test.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/jtx/Env_test.cpp b/src/test/jtx/Env_test.cpp index b3c2c78114..f3f3e1c047 100644 --- a/src/test/jtx/Env_test.cpp +++ b/src/test/jtx/Env_test.cpp @@ -587,6 +587,20 @@ public: env(noop("alice"), memo("data1", "format1", "type1"), memo("data2", "format2", "type2")); } + void + testMemoResult() + { + using namespace jtx; + Env env(*this); + JTx jt(noop("alice")); + memo("data", "format", "type")(env, jt); + + auto const& memo = jt.jv["Memos"][0u]["Memo"]; + BEAST_EXPECT(memo["MemoData"].asString() == strHex(std::string("data"))); + BEAST_EXPECT(memo["MemoFormat"].asString() == strHex(std::string("format"))); + BEAST_EXPECT(memo["MemoType"].asString() == strHex(std::string("type"))); + } + void testAdvance() { @@ -859,6 +873,7 @@ public: testJTxCopy(); testJTxMove(); testMemo(); + testMemoResult(); testAdvance(); testClose(); testPath();