mirror of
https://github.com/lucaspalomodevelop/lpstd.git
synced 2026-03-12 23:27:22 +00:00
change 'Restults' to 'TestingResults' and 'Results' to 'results'
This commit is contained in:
parent
d6bac8ec4a
commit
2f3fc70cd8
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
main.cpp
|
test.cpp
|
||||||
*.exe
|
*.exe
|
||||||
*.out
|
*.out
|
||||||
.vscode
|
.vscode
|
||||||
|
makefile
|
||||||
@ -32,7 +32,8 @@ namespace lpstd
|
|||||||
|
|
||||||
commandInfo currentCommand = {name : "",
|
commandInfo currentCommand = {name : "",
|
||||||
description : "",
|
description : "",
|
||||||
func : nullptr};
|
func : nullptr,
|
||||||
|
args : {}};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Command(/* args */)
|
Command(/* args */)
|
||||||
|
|||||||
@ -13,13 +13,13 @@ namespace lpstd
|
|||||||
namespace testing
|
namespace testing
|
||||||
{
|
{
|
||||||
|
|
||||||
struct Results
|
struct Testingresults
|
||||||
{
|
{
|
||||||
int passed = 0;
|
int passed = 0;
|
||||||
int failed = 0;
|
int failed = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
Results Results;
|
Testingresults results;
|
||||||
|
|
||||||
void drawResults()
|
void drawResults()
|
||||||
{
|
{
|
||||||
@ -27,13 +27,13 @@ namespace lpstd
|
|||||||
needUTF8();
|
needUTF8();
|
||||||
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
if (Results.failed == 0)
|
if (results.failed == 0)
|
||||||
{
|
{
|
||||||
std::cout << "=== ✅ All tests passed ===" << std::endl;
|
std::cout << "=== ✅ All tests passed ===" << std::endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "=== ❌ " << Results.failed << " tests failed ===" << std::endl;
|
std::cout << "=== ❌ " << results.failed << " tests failed ===" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,12 +55,12 @@ namespace lpstd
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
std::cout << "✅ Expected " << this->value << " to be " << expected << std::endl;
|
std::cout << "✅ Expected " << this->value << " to be " << expected << std::endl;
|
||||||
Results.passed++;
|
results.passed++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "❌ Expected " << expected << " but got " << this->value << std::endl;
|
std::cout << "❌ Expected " << expected << " but got " << this->value << std::endl;
|
||||||
Results.failed++;
|
results.failed++;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -71,12 +71,12 @@ namespace lpstd
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
std::cout << "✅ Expected " << this->value << " to be greater than " << expected << std::endl;
|
std::cout << "✅ Expected " << this->value << " to be greater than " << expected << std::endl;
|
||||||
Results.passed++;
|
results.passed++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "❌ Expected " << this->value << " to be greater than " << expected << std::endl;
|
std::cout << "❌ Expected " << this->value << " to be greater than " << expected << std::endl;
|
||||||
Results.failed++;
|
results.failed++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -88,12 +88,12 @@ namespace lpstd
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
std::cout << "✅ Expected " << this->value << " to be less than " << expected << std::endl;
|
std::cout << "✅ Expected " << this->value << " to be less than " << expected << std::endl;
|
||||||
Results.passed++;
|
results.passed++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "❌ Expected " << this->value << " to be less than " << expected << std::endl;
|
std::cout << "❌ Expected " << this->value << " to be less than " << expected << std::endl;
|
||||||
Results.failed++;
|
results.failed++;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -104,12 +104,12 @@ namespace lpstd
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
std::cout << "✅ Expected " << this->value << " to be true" << std::endl;
|
std::cout << "✅ Expected " << this->value << " to be true" << std::endl;
|
||||||
Results.passed++;
|
results.passed++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "❌ Expected " << this->value << " to be true" << std::endl;
|
std::cout << "❌ Expected " << this->value << " to be true" << std::endl;
|
||||||
Results.failed++;
|
results.failed++;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -120,12 +120,12 @@ namespace lpstd
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
std::cout << "✅ Expected " << this->value << " to be false" << std::endl;
|
std::cout << "✅ Expected " << this->value << " to be false" << std::endl;
|
||||||
Results.passed++;
|
results.passed++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "❌ Expected " << this->value << " to be false" << std::endl;
|
std::cout << "❌ Expected " << this->value << " to be false" << std::endl;
|
||||||
Results.failed++;
|
results.failed++;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -136,12 +136,12 @@ namespace lpstd
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
std::cout << "✅ Expected " << this->value << " to be close to " << expected << std::endl;
|
std::cout << "✅ Expected " << this->value << " to be close to " << expected << std::endl;
|
||||||
Results.passed++;
|
results.passed++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "❌ Expected " << this->value << " to be close to " << expected << std::endl;
|
std::cout << "❌ Expected " << this->value << " to be close to " << expected << std::endl;
|
||||||
Results.failed++;
|
results.failed++;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -185,11 +185,11 @@ namespace lpstd
|
|||||||
catch (std::exception &e)
|
catch (std::exception &e)
|
||||||
{
|
{
|
||||||
std::cout << "✅ Expected exception thrown: " << e.what() << std::endl;
|
std::cout << "✅ Expected exception thrown: " << e.what() << std::endl;
|
||||||
Results.passed++;
|
results.passed++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::cout << "❌ Expected exception not thrown" << std::endl;
|
std::cout << "❌ Expected exception not thrown" << std::endl;
|
||||||
Results.failed++;
|
results.failed++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user