-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTLD-test.cpp
30 lines (22 loc) · 908 Bytes
/
TLD-test.cpp
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
#include "TLD.hpp"
#include <iostream>
int main(int argc, char const* argv[])
{
TLD tld;
CHECK_NOTNULL(tld.get_registered_domain("digilicious.com"));
CHECK_NOTNULL(tld.get_registered_domain("yahoo.com"));
CHECK_NOTNULL(tld.get_registered_domain("google.com"));
CHECK_NOTNULL(tld.get_registered_domain("foo.blogspot.com.ar"));
CHECK_EQ(strcmp(tld.get_registered_domain("pi.digilicious.com"),
"digilicious.com"),
0);
CHECK_EQ(strcmp(tld.get_registered_domain("outmail14.phi.meetup.com"),
"meetup.com"),
0);
CHECK(nullptr == tld.get_registered_domain("not_a_domain_at_all"));
CHECK(nullptr == tld.get_registered_domain(".com"));
CHECK(nullptr == tld.get_registered_domain("."));
CHECK_EQ(strcmp(tld.get_registered_domain("reward.yournewestbonuspoints.com"),
"yournewestbonuspoints.com"),
0);
}