git-svn-id: svn://ultimatepp.org/upp/trunk@7068 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-03-21 13:11:55 +00:00
parent bca9fad03a
commit d1d3480cd3
4 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,26 @@
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
Vector<String> h = Split("alfa,beta,,gamma", ',', false);
// DUMP(Join(h, ","));
// DUMP(Join(h, ",", true));
String a, b, c;
SplitTo("one", ',', a, b, c);
DUMP(SplitTo("one", ',', a, b, c));
DUMP(SplitTo("one,two,,three", ',', a, b, c));
DUMP(MakeTuple(a, b, c));
DUMP(SplitTo("one,two,,three", ',', false, a, b, c));
DUMP(MakeTuple(a, b, c));
DUMP(SplitTo("one,two,,three", ",", a, b, c));
DUMP(MakeTuple(a, b, c));
DUMP(SplitTo("one,two,,three", ",", false, a, b, c));
DUMP(MakeTuple(a, b, c));
}

View file

@ -0,0 +1,9 @@
uses
Core;
file
SplitJoin.cpp;
mainconfig
"" = "SSE2";

4
upptst/SplitJoin/init Normal file
View file

@ -0,0 +1,4 @@
#ifndef _SplitJoin_icpp_init_stub
#define _SplitJoin_icpp_init_stub
#include "Core/init"
#endif

View file

@ -13,6 +13,12 @@ void Check(T haystack, T needle, int pos)
DUMP(haystack.Find(needle));
NEVER();
}
if(haystack.ReverseFind(needle) != pos) {
DUMP(haystack);
DUMP(needle);
DUMP(haystack.ReverseFind(needle));
NEVER();
}
}
template <class T>