Skip to content

Commit

Permalink
Update test_reads! macro
Browse files Browse the repository at this point in the history
  • Loading branch information
alkor committed Jan 11, 2015
1 parent cfe063d commit b2d6dfc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/http/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub fn read_http_version<R: Reader, F: FnMut(u8) -> bool>

// I couldn't think what to call it. Ah well. It's just trivial syntax sugar, anyway.
macro_rules! test_reads {
($func:ident $($value:expr => $expected:expr),*) => {{
($func:ident, $($value:expr => $expected:expr),*) => {{
$(
assert_eq!(
concat_idents!(read_, $func)(&mut MemReader::new($value.bytes().collect::<Vec<_>>()),
Expand All @@ -179,7 +179,7 @@ macro_rules! test_reads {

#[test]
fn test_read_http_version() {
test_reads!(http_version
test_reads!(http_version,
"HTTP/25.17\0" => Some((25, 17)),
"http/1.0\0" => Some((1, 0)),
"http 1.0\0" => None,
Expand All @@ -190,7 +190,7 @@ fn test_read_http_version() {

#[test]
fn test_read_decimal() {
test_reads!(decimal
test_reads!(decimal,
"0\0" => Some(0u),
"0\0" => Some(0u8),
"0\0" => Some(0u64),
Expand All @@ -217,7 +217,7 @@ fn test_read_decimal() {

#[test]
fn test_read_hexadecimal() {
test_reads!(hexadecimal
test_reads!(hexadecimal,
"0\0" => Some(0u),
"0\0" => Some(0u8),
"0\0" => Some(0u64),
Expand Down

0 comments on commit b2d6dfc

Please sign in to comment.