20 std::vector<RFC2616::TokenQPair>
output;
22 string test1(
"iso-8859-5, unicode-1-1;q=0.8");
31 string test2(
"compress, gzip");
45 string test4(
"compress;q=0.5, gzip;q=1.0");
54 string test5(
"gzip;q=1.0, identity; q=0.5, *;q=0");
65 string test6(
"da, en-gb;q=0.8, en;q=0.7");
79 std::vector<RFC2616::TokenQPair>
output;
81 string test1(
" iso-8859-5, unicode-1-1; q=0.8 hi mom!");
98 TEST(QvalueTest, Invalids) {
100 std::vector<RFC2616::TokenQPair>
output;
107 string test2(
" ; q=0.1");
112 string test3(
"gzip; q=uietplease");
119 string test4(
"gzip; whoohoo, defalte");
130 TEST(ByteRangeSpecTest, Valids) {
131 unsigned long firstByte = ULONG_MAX;
132 unsigned long lastByte = ULONG_MAX;
133 unsigned long instanceLength = ULONG_MAX;
138 firstByte, lastByte, instanceLength));
146 firstByte, lastByte, instanceLength));
154 firstByte, lastByte, instanceLength));
160 TEST(ByteRangeSpecTest, Invalids) {
164 "Spec must start with 'bytes '";
166 "Spec missing initial range";
168 "Spec missing last byte in initial range";
170 "Spec missing '/' separator";
172 "Spec has trailing garbage";
174 "Spec initial range is invalid";
176 "Spec initial range is invalid too large";
178 "Spec initial range has invalid first byte";
180 "Spec initial range has invalid last bytek";
182 "Spec cannot contain wildcard in initial range";
184 "Spec cannot contain wildcard in initial range";
189 "Spec StringPiece ends before instance length";
192 "Spec StringPiece ends before '/' character";
195 "Spec StringPiece ends before last byte in initial byte range";
198 "Spec StringPiece ends before '-' in initial byte range";
201 "Spec StringPiece ends before first byte in initial byte range";
#define EXPECT_EQ(val1, val2)
#define EXPECT_TRUE(condition)
#define EXPECT_DOUBLE_EQ(val1, val2)
void subtract(size_type n)
bool parseByteRangeSpec(folly::StringPiece value, unsigned long &outFirstByte, unsigned long &outLastByte, unsigned long &outInstanceLength)
#define EXPECT_FALSE(condition)
#define ASSERT_TRUE(condition)
bool parseQvalues(folly::StringPiece value, std::vector< TokenQPair > &output)
constexpr detail::First first