Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mtsas mtsas thermostat_fan_demo--fan mtsas ... more
TestMTSText.h
00001 #ifndef TESTMTSTEXT_H 00002 #define TESTMTSTEXT_H 00003 00004 #include <string> 00005 #include <vector> 00006 00007 #include "MTSText.h" 00008 00009 using namespace mts; 00010 00011 class TestMTSText : public TestCollection 00012 { 00013 public: 00014 TestMTSText(); 00015 ~TestMTSText(); 00016 00017 virtual void run(); 00018 }; 00019 00020 TestMTSText::TestMTSText() : TestCollection("MTSText") {} 00021 00022 TestMTSText::~TestMTSText() {} 00023 00024 void TestMTSText::run() { 00025 //Testing split method (char delimeter) 00026 Test::start("split method (char delimeter)"); 00027 std::string source = "ABC,,456"; 00028 std::vector<std::string> split = Text::split(source, ','); 00029 Test::assertTrue(split.size() == 3); 00030 Test::assertTrue(split[0].compare("ABC") == 0); 00031 Test::assertTrue(split[1].compare("") == 0); 00032 Test::assertTrue(split[2].compare("456") == 0); 00033 Test::end(); 00034 } 00035 00036 #endif /* TESTMTSTEXT_H */
Generated on Thu Jul 14 2022 17:11:00 by
1.7.2