Files
textmate/Frameworks/text/tests/t_encode.cc
2013-07-26 13:53:58 +02:00

10 lines
458 B
C++

#include <text/encode.h>
void test_url ()
{
OAK_ASSERT_EQ("http://host/" + encode::url_part("æblegrød.html"), "http://host/%C3%A6blegr%C3%B8d.html");
OAK_ASSERT_EQ(encode::url_part("http://example?a=b&c=d"), "http%3A%2F%2Fexample%3Fa%3Db%26c%3Dd");
OAK_ASSERT_EQ(encode::url_part("me@example.org"), "me%40example.org");
OAK_ASSERT_EQ("file://localhost" + encode::url_part("/foo/bar/file name.txt", "/"), "file://localhost/foo/bar/file%20name.txt");
}