File: encoded_auth_tests.cpp

package info (click to toggle)
cpr 1.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,452 kB
  • sloc: cpp: 14,315; ansic: 637; sh: 139; xml: 38; makefile: 16
file content (20 lines) | stat: -rw-r--r-- 489 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <gtest/gtest.h>

#include <string>

#include "cpr/cpr.h"

using namespace cpr;

TEST(EncodedAuthenticationTests, UnicodeEncoderTest) {
    std::string user = "一二三";
    std::string pass = "Hello World!";
    EncodedAuthentication pa{user, pass};
    EXPECT_EQ(pa.GetUsername(), "%E4%B8%80%E4%BA%8C%E4%B8%89");
    EXPECT_EQ(pa.GetPassword(), "Hello%20World%21");
}

int main(int argc, char** argv) {
    ::testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
}