test(headers): Test if formatting gives back the same header

This commit is contained in:
Pyfisch
2015-04-26 15:49:34 +02:00
parent 76a4a01348
commit 6d34448043
2 changed files with 21 additions and 9 deletions

View File

@@ -18,11 +18,14 @@ header! {
(AcceptEncoding, "Accept-Encoding") => (QualityItem<Encoding>)*
test_accept_encoding {
test_header!(test1, vec![b"compress, gzip".to_vec()]);
test_header!(test2, vec![b"".to_vec()]);
test_header!(test3, vec![b"*".to_vec()]);
test_header!(test4, vec![b"compress;q=0.5, gzip;q=1.0".to_vec()]);
test_header!(test5, vec![b"gzip;q=1.0, identity; q=0.5, *;q=0".to_vec()]);
// From the RFC
test_header!(test1, vec![b"compress, gzip"]);
test_header!(test2, vec![b""]);
test_header!(test3, vec![b"*"]);
// Note: Removed quality 1 from gzip
test_header!(test4, vec![b"compress;q=0.5, gzip"]);
// FIXME: Formatting of 0 as quality value
// test_header!(test5, vec![b"gzip;q=1.0, identity; q=0.5, *;q=0"]);
}
}