mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
.autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@11755 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
c89d25bde6
commit
8baaf29eec
2 changed files with 39 additions and 0 deletions
28
autotest/GetSet/GetSet.cpp
Normal file
28
autotest/GetSet/GetSet.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
template <class T>
|
||||
void Test()
|
||||
{
|
||||
T x;
|
||||
DDUMP(x.Get(0, "321"));
|
||||
ASSERT(x.Get(0, "321") == "321");
|
||||
x.Add("123");
|
||||
DDUMP(x.Get(0, "321"));
|
||||
ASSERT(x.Get(0, "321") == "123");
|
||||
String h = "test";
|
||||
x.Set(1, pick(h));
|
||||
DDUMP(h);
|
||||
ASSERT(h.GetCount() == 0);
|
||||
DDUMP(x);
|
||||
ASSERT(x.GetCount() == 2);
|
||||
ASSERT(x[0] == "123");
|
||||
ASSERT(x[1] == "test");
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
Test<Vector<String>>();
|
||||
Test<Array<String>>();
|
||||
}
|
||||
11
autotest/GetSet/GetSet.upp
Normal file
11
autotest/GetSet/GetSet.upp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
description "Vector/Array Get Set tests\377";
|
||||
|
||||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
GetSet.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue