Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions singleheader/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "ada_idna.h"

int main(int, char *[]) {
std::string input (
std::string input(
"\x2d\x2d\x5d\x2d\x2d\x2d\x2d\x01\x00\x00\x00\x00\x00\x00\x77\x6d\x2d\x77"
"\x77\x6d\x77\x2d\x77\x77\x77\x77\x77\x77\x73\x61\x61\x61\x61\x61\x61\x61"
"\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61"
Expand Down Expand Up @@ -10826,14 +10826,15 @@ int main(int, char *[]) {
"\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61"
"\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61"
"\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61"
"\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x77\x77\x73",194796)
;
std::u32string output;
bool x = ada::idna::punycode_to_utf32(input, output);
std::cout << x << std::endl;
std::cout << input.size() << std::endl;
std::cout << output.size()*sizeof(uint32_t) << std::endl;
"\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x61\x77\x77"
"\x73",
194796);
std::u32string output;
bool x = ada::idna::punycode_to_utf32(input, output);
std::cout << x << std::endl;
std::cout << input.size() << std::endl;
std::cout << output.size() * sizeof(uint32_t) << std::endl;

//auto url = ada::idna::to_ascii("www.google.com");
// auto url = ada::idna::to_ascii("www.google.com");
return EXIT_SUCCESS;
}
10 changes: 10 additions & 0 deletions tests/to_ascii_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,17 @@ bool special_cases() {
return true;
}

bool comma_test() {
if (ada::idna::to_ascii("128.0,0.1").empty()) {
return false;
}
return true;
}

int main(int argc, char** argv) {
if (!comma_test()) {
return EXIT_FAILURE;
}
if (!special_cases()) {
return EXIT_FAILURE;
}
Expand Down