33 lines
997 B
C++
33 lines
997 B
C++
#include <iostream>
|
|
#include "../MString.h"
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
// Literal string assignment tests.
|
|
coreutils::MString test1 = "this is an assignment test.";
|
|
std::cout << "char * operator=: [" << test1 << "]." << std::endl;
|
|
test1 = "new value.";
|
|
std::cout << "char * operator=: [" << test1 << "]." << std::endl;
|
|
|
|
coreutils::MString test2("this is another test.");
|
|
std::cout << "assign on constructor: [" << test2 << "]." << std::endl;
|
|
|
|
// Character assignment tests.
|
|
coreutils::MString test3;
|
|
test3 = 'a';
|
|
std::cout << "char operator=: [" << test3 << "]." << std::endl;
|
|
|
|
coreutils::MString test4;
|
|
test4 << "this is a test.";
|
|
std::cout << "char* operator<<: [" << test4 << "]." << std::endl;
|
|
|
|
// String building tests.
|
|
coreutils::MString test5("/this/is/a/path");
|
|
coreutils::MString test6("/filename");
|
|
test5.write(test6);
|
|
std::cout << "test write: [" << test5 << "]." << std::endl;
|
|
|
|
return 0;
|
|
}
|
|
|