<commit_before>#include "gtest/gtest.h"

#include "../src/base/lib_common2.hpp"
#include "../src/base/lib_common3.hpp"

#include "../src/base/useot.hpp"
                                                                                                                                                                                                                                                                                
using namespace nOT::nUtils;                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                
class cUseOtOutPaymentTest: public testing::Test {                                                                                                                                                                                                                                  
protected:                                                                                                                                                                                                                                                                      
        std::shared_ptr<nOT::nUse::cUseOT> useOt;                                                                                                                                                                                                                               
        virtual void SetUp() {                                                                                                                                                                                     
                useOt = std::make_shared<nOT::nUse::cUseOT>("outpayment-cheque");                                                                                                                                        
                                                                                                                                                                                                                                              
                cout << "outpayment test" << endl;                                                                                                                                                                                                
        }                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                              
        virtual void TearDown() {                                                                                                                                                                                                             
                cout << "tear down" << endl;                                                                                                                                                                                                  
        }
};

<commit_msg>commandline tests<commit_after>#include "gtest/gtest.h"

#include "../src/base/lib_common2.hpp"
#include "../src/base/lib_common3.hpp"

#include "../src/base/useot.hpp"
#include "../src/base/cmd.hpp"

using namespace nOT::nUtils;

class cUseOtOutpaymentTest: public testing::Test {
protected:
	std::shared_ptr<nOT::nUse::cUseOT> useOt;
	string nym1;
	string preCmd;

	virtual void SetUp() {
		useOt = std::make_shared<nOT::nUse::cUseOT>("outpayment-cheque");
		nym1 = "FT's Test Nym";
		preCmd = "ot outpayment ";

		cout << "outpayment test" << endl;
	}

	virtual void TearDown() {
		cout << "tear down" << endl;
	}
};

TEST_F(cUseOtOutpaymentTest, cmdOk) {
	shared_ptr<nOT::nNewcli::cCmdParser> parser(new nOT::nNewcli::cCmdParser);
	parser->Init();
	auto tmp = parser->StartProcessing("ot outpayment ls", useOt);
	tmp.UseExecute();

}

TEST_F(cUseOtOutpaymentTest, cmdFail) {
	shared_ptr<nOT::nNewcli::cCmdParser> parser(new nOT::nNewcli::cCmdParser);
	parser->Init();

	string cmd = preCmd + "show " + nym1 + " -1";
	_fact(cmd);
	EXPECT_ANY_THROW(parser->StartProcessing(cmd, useOt).UseExecute());

	cmd = preCmd + "show " + nym1 + " 1000";
	_fact(cmd);
	EXPECT_ANY_THROW(parser->StartProcessing(cmd, useOt).UseExecute());

}

{'fraction_non_alphanumeric': 0.0626143525106729, 'fraction_numerical': 0.002642813579995934, 'mean_word_length': 0.4190943178540525, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 145, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3841718', 'n_tokens_mistral': 712, 'n_tokens_neox': 673, 'n_words': 118}