From 6f166433b590be44e089790095b3fb145bab2dea Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Sun, 16 Jan 2022 08:36:52 -0600 Subject: [PATCH] fix: test failures --- src/subscription.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/subscription.rs b/src/subscription.rs index 012b719..7dd53ac 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -208,10 +208,10 @@ mod tests { } #[test] - fn invalid_filter() { - // unrecognized field in filter - let raw_json = "[\"REQ\",\"some-id\",{\"foo\": 3}]"; - assert!(serde_json::from_str::(raw_json).is_err()); + fn legacy_filter() { + // legacy field in filter + let raw_json = "[\"REQ\",\"some-id\",{\"kind\": 3}]"; + assert!(serde_json::from_str::(raw_json).is_ok()); } #[test] @@ -249,7 +249,8 @@ mod tests { #[test] fn interest_time_and_id() -> Result<()> { // subscription with a filter for ID and time - let s: Subscription = serde_json::from_str(r#"["REQ","xyz",{"ids": ["abc"], "since": 1000}]"#)?; + let s: Subscription = + serde_json::from_str(r#"["REQ","xyz",{"ids": ["abc"], "since": 1000}]"#)?; let e = Event { id: "abc".to_owned(), pubkey: "".to_owned(),