Initial test bootstrap.
This commit is contained in:
parent
6c618749f1
commit
4b308f6c32
94 changed files with 2543 additions and 681 deletions
|
@ -1,8 +1,43 @@
|
|||
#include "StringUtils.h"
|
||||
#include "String.h"
|
||||
|
||||
#include "TestFramework.h"
|
||||
#include "TestUtils.h"
|
||||
//#include "TestUtils.h"
|
||||
#include <iostream>
|
||||
|
||||
TEST_CASE(TestBasicStringOps, "core")
|
||||
{
|
||||
String str;
|
||||
str += 'a';
|
||||
str += 'b';
|
||||
str += 'c';
|
||||
str += 'd';
|
||||
REQUIRE(str == "abcd");
|
||||
}
|
||||
|
||||
TEST_CASE(TestStringReverse, "core")
|
||||
{
|
||||
String str0;
|
||||
str0.reverse();
|
||||
REQUIRE(str0.empty());
|
||||
|
||||
String str1("a");
|
||||
str1.reverse();
|
||||
REQUIRE(str1 == "a");
|
||||
|
||||
String str2("ab");
|
||||
str2.reverse();
|
||||
REQUIRE(str2 == "ba");
|
||||
|
||||
String str3("abc");
|
||||
str3.reverse();
|
||||
REQUIRE(str3 == "cba");
|
||||
|
||||
String str4("abcd");
|
||||
str4.reverse();
|
||||
REQUIRE(str4 == "dcba");
|
||||
}
|
||||
|
||||
/*
|
||||
TEST_CASE(TestStringUtils_StripSurroundingWhitepsace, "core")
|
||||
{
|
||||
std::string input = " super() ";
|
||||
|
@ -28,3 +63,5 @@ TEST_CASE(TestStringUtils_startsWith, "core")
|
|||
starts_with = StringUtils::startsWith(input, "```", ignore_whitespace);
|
||||
REQUIRE(starts_with);
|
||||
}
|
||||
|
||||
*/
|
18
test/core/TestVector.cpp
Normal file
18
test/core/TestVector.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "Vector.h"
|
||||
|
||||
#include "TestFramework.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
TEST_CASE(TestVectorOps, "core")
|
||||
{
|
||||
Vector<size_t> vec;
|
||||
for(size_t idx=0;idx<100;idx++)
|
||||
{
|
||||
vec.push_back(idx);
|
||||
}
|
||||
for(size_t idx=0; idx<100; idx++)
|
||||
{
|
||||
REQUIRE(vec[idx] == idx);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue