#[macro_use]
extern crate tower_web;
mod empty_impl {
#[derive(Clone, Debug)]
struct Empty;
impl_web! {
impl Empty {
}
}
#[test]
fn use_type() {
let _v = Empty;
}
}
mod no_routes {
#[derive(Clone)]
struct Empty;
impl_web! {
impl Empty {
fn foo(&self) {
}
}
}
#[test]
fn use_type() {
let v = Empty;
v.foo();
}
}
mod other_attr {
#[derive(Clone)]
struct Empty;
impl_web! {
impl Empty {
#[inline]
fn foo(&self) {
}
}
}
#[test]
fn use_type() {
let v = Empty;
v.foo();
}
}
mod one_route {
#[derive(Clone)]
struct OneRoute;
impl_web! {
impl OneRoute {
#[get("/")]
fn foo(&self) -> Result<String, ()> {
Ok("foo".to_string())
}
}
}
#[test]
fn use_type() {
let v = OneRoute;
assert_eq!("foo", v.foo().unwrap());
}
}