zk-Armor/ohmyagent / bonsai.cpp /tests /test-unicode.cpp
zk-Armor's picture
download
raw
589 Bytes
#include "../src/unicode.h"
#include <cstdio>
#include <string>
#include <vector>
int main() {
const std::vector<std::string> regex_exprs = {
"[~][A-Za-z]+| ?[\\p{S}]+|\\s+",
};
const std::vector<std::string> expected = { " ~", "foo" };
const auto actual = unicode_regex_split(" ~foo", regex_exprs, false);
if (actual != expected) {
fprintf(stderr, "unexpected split:");
for (const auto & piece : actual) {
fprintf(stderr, " [%s]", piece.c_str());
}
fprintf(stderr, "\n");
return 1;
}
return 0;
}

Xet Storage Details

Size:
589 Bytes
·
Xet hash:
1e8b427f58d6beb74bc06b259c703d97b0c51d0c71e159e5efbd0f959b99abbf

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.