Trying to fix MString assignments.

This commit is contained in:
Brad Arant committed 2023-10-10 15:49:46 -07:00
1 parent 74ab316e64
commit d020363bc9
12 files changed
+75 -16

No files matched your search

+1
View File
@@ -0,0 +1 @@
{"name":"Stephonivich","race":"Human","health","100"}
Binary file not shown.
Binary file not shown.
+12 -3
View File
@@ -19,7 +19,7 @@ int main(int argc, char **argv) {
coreutils::MString ytest("this is a test");
xtest = ytest;
std::cout << "assign mstring to mstring: " << xtest << std::endl;
// Character assignment tests.
coreutils::MString test3;
test3 = 'a';
@@ -29,6 +29,7 @@ int main(int argc, char **argv) {
coreutils::MString test4;
test4 << "this is a test." << test7;
std::cout << "char* operator<<: [" << test4 << "]." << std::endl;
test4 << "another test " << 75;
std::cout << "char* operator<<: [" << test4 << "]." << std::endl;
@@ -43,7 +44,7 @@ int main(int argc, char **argv) {
std::cout << "streaming from std::string: [" << test14 << "]." << std::endl;
coreutils::MString test9("XXXXXXXXXYYYYYYYYYY");
std::cout << "test insert: " << test9 << std::endl;
std::cout << "test insert: " << test9 << std::endl;
coreutils::MString test8("zzz");
test9.insert(test8, 9);
test9.insert("aaaaa", 9);
@@ -64,10 +65,18 @@ int main(int argc, char **argv) {
coreutils::MString test21;
test21 = test20;
std::cout << "mstring = zstring: [" << test21 << "]" << std::endl;
coreutils::MString test22;
test22 << test20;
std::cout << "mstring << zstring: [" << test22 << "]" << std::endl;
std::string test23 = "this is a string";
test22 = test23;
std::cout << "mstring = string: [" << test22 << "]" << std::endl;
test22 << test23;
std::cout << "mstring << string: [" << test22 << "]" << std::endl;
return 0;
}
Binary file not shown.
+9
View File
@@ -1,5 +1,6 @@
#include <iostream>
#include "../ZString.h"
#include "../MString.h"
int main(int argc, char **argv) {
@@ -44,4 +45,12 @@ int main(int argc, char **argv) {
std::cout << "find MX: " << testA.find("MX") << std::endl;
std::cout << "unparsed: " << testA.unparsed() << std::endl;
std::string testb = "this is a string";
coreutils::ZString testc = testb;
std::cout << testc << std::endl;
coreutils::MString testd = "this is an mstring";
testc = testd;
std::cout << testc << std::endl;
}