Skip to content

Commit

Permalink
chore(cfail): update cfail test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryman committed Aug 1, 2015
1 parent 47a728d commit 4fb224d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 55 deletions.
8 changes: 4 additions & 4 deletions tests/compile-fail/inference_fully_hinted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use nickel::{Nickel, HttpRouter, Request, Response};
fn main() {
let mut server = Nickel::new();

server.utilize(|_: &mut Request<()>, res: Response<()>| res.send("Hello World!"));
//~^ ERROR type mismatch resolving `for<'r, 'b, 'a> <[closure tests/com
server.utilize(|res: Response<()>| res.send("Hello World!"));
//~^ ERROR type mismatch resolving `for<'a, 'k> <[closure@tests/com

server.get("**", |_: &mut Request<()>, res: Response<()>| res.send("Hello World!"));
//~^ ERROR type mismatch resolving `for<'r, 'b, 'a> <[closure tests/com
server.get("**", |res: Response<()>| res.send("Hello World!"));
//~^ ERROR type mismatch resolving `for<'a, 'k> <[closure@tests/com

server.listen("127.0.0.1:6767");
}
12 changes: 5 additions & 7 deletions tests/compile-fail/inference_no_hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@

#[macro_use] extern crate nickel;

use nickel::{Nickel, HttpRouter, Request, Response};
use nickel::{Nickel, HttpRouter};

fn main() {
let mut server = Nickel::new();

server.utilize(|_, res| res.send("Hello World!"));
//~^ ERROR type mismatch resolving `for<'r, 'b, 'a> <[closure tests/compile-fail
server.utilize(|res| res.send("Hello World!"));
//~^ ERROR type mismatch resolving `for<'a, 'k> <[closure@tests/compile-fail
//~^^ ERROR the type of this value must be known in this context
//~^^^ ERROR type mismatch: the type `[closure tests/compile

server.get("**", |_, res| res.send("Hello World!"));
//~^ ERROR type mismatch resolving `for<'r, 'b, 'a> <[closure tests/compile-fail
server.get("**", |res| res.send("Hello World!"));
//~^ ERROR type mismatch resolving `for<'a, 'k> <[closure@tests/compile-fail
//~^^ ERROR the type of this value must be known in this context
//~^^^ ERROR type mismatch: the type `[closure tests/compile

server.listen("127.0.0.1:6767");
}
21 changes: 0 additions & 21 deletions tests/compile-fail/inference_request_hinted.rs

This file was deleted.

20 changes: 0 additions & 20 deletions tests/compile-fail/inference_response_hinted.rs

This file was deleted.

6 changes: 3 additions & 3 deletions tests/compile-fail/unmet_data_requirement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ fn main() {

// Note: Don't use get for login in real applications ;)
// Try http://localhost:6767/login?name=foo
server.get("/login", middleware! { |req, mut res|
server.get("/login", middleware! { |mut res|
let jar = res.cookies_mut()
//~^ ERROR: the trait `core::convert::AsRef<nickel::cookies::SecretKey>` is not implemented for the type `Data`
// long life cookies!
.permanent();

let name = req.query().get("name")
.unwrap_or("default_name");
let name = res.request.query().get("name")
.unwrap_or("default_name");
let cookie = Cookie::new("MyCookie".to_owned(),
name.to_owned());
jar.add(cookie);
Expand Down

0 comments on commit 4fb224d

Please sign in to comment.