5 #include <gflags/gflags.h>
7 #include <glog/logging.h>
9 #include <fmt/format.h>
10 #include <fmt/ostream.h>
12 void check_mbx(std::string_view mbx
)
14 if (!Mailbox::validate(mbx
))
15 LOG(ERROR
) << "invalid mailbox: " << mbx
;
18 int main(int argc
, char* argv
[])
20 std::ios::sync_with_stdio(false);
21 google::ParseCommandLineFlags(&argc
, &argv
, true);
25 char const* sender
= "\"gene\"@digilicious.com";
26 char const* alias
= "♥.digilicious.com";
27 char const* alias2
= "xn--g6h.digilicious.com";
29 auto const fwd
= srs
.forward(sender
, alias
);
30 auto const fwd2
= srs
.forward(fwd
.c_str(), alias2
);
31 auto const rev
= srs
.reverse(fwd
.c_str());
33 LOG(INFO
) << "sender == " << sender
;
34 LOG(INFO
) << "alias == " << alias
;
35 LOG(INFO
) << " fwd == " << fwd
;
36 LOG(INFO
) << " fwd2 == " << fwd2
;
37 LOG(INFO
) << " rev == " << rev
;
44 CHECK_EQ(rev
, sender
);