Compare commits
1 Commits
master
...
data_drive
Author | SHA1 | Date | |
---|---|---|---|
60316e5593 |
@ -1,3 +1,4 @@
|
|||||||
|
#![feature(concat_idents)]
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::sync::mpsc;
|
use std::sync::mpsc;
|
||||||
use std::thread::{self, JoinHandle};
|
use std::thread::{self, JoinHandle};
|
||||||
|
10
src/proto.rs
10
src/proto.rs
@ -228,9 +228,19 @@ pub enum DNSParseError {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
macro_rules! data_driven_test {
|
||||||
|
($name:expr, $func:expr, $input:literal, $output:literal) => {
|
||||||
|
#[test]
|
||||||
|
fn concat_idents!($name, _test) {
|
||||||
|
assert_eq!($input, $output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mod from_udp_datagram {
|
mod from_udp_datagram {
|
||||||
|
|
||||||
|
data_driven_test!("my_macro_test", somefunc, 5, 5);
|
||||||
|
|
||||||
mod header_length {
|
mod header_length {
|
||||||
use super::super::super::*;
|
use super::super::super::*;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user