-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (28 loc) · 721 Bytes
/
Copy pathmain.cpp
File metadata and controls
37 lines (28 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "String.h"
#include <cassert>
int main() {
assert(String("test") == String(std::string("test")));
String s = "a";
s = "a";
s = std::string("b");
String ss = s;
s += String("b");
s += std::string("c");
s += "d";
assert(s == "bbcd");
assert (s.std_string() == std::string("bbcd"));
assert(s.length() == 4);
assert(ss != s);
String a = "ab";
String b = std::string("b");
String c = String("abc");
assert(a < b);
assert(a != b);
assert(c >= a);
String c1("a");
String c2 = 'a';
assert(c1 == c2);
// assert(false);
std::cout << "All asserts passed" << std::endl;
return 0;
}