Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imbolc committed Feb 23, 2022
1 parent d8de7cb commit 121dedc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ mod tests {
#[test]
fn get_absent() {
let key = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
assert_eq!(cookies.private(&key).get("foo"), None);
}

#[test]
fn add_get_private() {
let key = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
let cookie = Cookie::new("foo", "bar");
let private = cookies.private(&key);
private.add(cookie.clone());
Expand All @@ -61,7 +61,7 @@ mod tests {
#[test]
fn add_private_get_raw() {
let key = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
let cookie = Cookie::new("foo", "bar");
cookies.private(&key).add(cookie.clone());
assert_ne!(cookies.get("foo").unwrap(), cookie);
Expand All @@ -70,7 +70,7 @@ mod tests {
#[test]
fn add_raw_get_private() {
let key = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
let cookie = Cookie::new("foo", "bar");
cookies.add(cookie);
assert_eq!(cookies.private(&key).get("foo"), None);
Expand All @@ -80,7 +80,7 @@ mod tests {
fn messed_keys() {
let key1 = Key::generate();
let key2 = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
let cookie = Cookie::new("foo", "bar");
cookies.private(&key1).add(cookie);
assert_eq!(cookies.private(&key2).get("foo"), None);
Expand All @@ -89,7 +89,7 @@ mod tests {
#[test]
fn remove() {
let key = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
let cookie = Cookie::new("foo", "bar");
let private = cookies.private(&key);
private.add(cookie.clone());
Expand Down
12 changes: 6 additions & 6 deletions src/signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ mod tests {
#[test]
fn get_absent() {
let key = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
assert_eq!(cookies.signed(&key).get("foo"), None);
}

#[test]
fn add_get_signed() {
let key = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
let cookie = Cookie::new("foo", "bar");
let signed = cookies.signed(&key);
signed.add(cookie.clone());
Expand All @@ -68,7 +68,7 @@ mod tests {
#[test]
fn add_signed_get_raw() {
let key = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
let cookie = Cookie::new("foo", "bar");
cookies.signed(&key).add(cookie.clone());
assert_ne!(cookies.get("foo").unwrap(), cookie);
Expand All @@ -77,7 +77,7 @@ mod tests {
#[test]
fn add_raw_get_signed() {
let key = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
let cookie = Cookie::new("foo", "bar");
cookies.add(cookie);
assert_eq!(cookies.signed(&key).get("foo"), None);
Expand All @@ -87,7 +87,7 @@ mod tests {
fn messed_keys() {
let key1 = Key::generate();
let key2 = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
let cookie = Cookie::new("foo", "bar");
cookies.signed(&key1).add(cookie);
assert_eq!(cookies.signed(&key2).get("foo"), None);
Expand All @@ -96,7 +96,7 @@ mod tests {
#[test]
fn remove() {
let key = Key::generate();
let cookies = Cookies::new(None);
let cookies = Cookies::new(vec![]);
let cookie = Cookie::new("foo", "bar");
let signed = cookies.signed(&key);
signed.add(cookie.clone());
Expand Down

0 comments on commit 121dedc

Please sign in to comment.