From 1aa551ada6fd682f9122e05746cf14c80899a811 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Wed, 9 Jun 2021 04:48:49 -0700 Subject: [PATCH] Ignore heartbeats in non-heartbeat SSE test. --- core/lib/src/response/stream/sse.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/lib/src/response/stream/sse.rs b/core/lib/src/response/stream/sse.rs index 6b640b17..a3c52fbf 100644 --- a/core/lib/src/response/stream/sse.rs +++ b/core/lib/src/response/stream/sse.rs @@ -699,20 +699,20 @@ mod sse_tests { use futures::stream::iter; let stream = EventStream::from(iter(vec![Event::data("foo")])); - assert_eq!(stream.into_string(), "data:foo\n\n"); + assert_eq!(stream.into_string().replace(":\n\n", ""), "data:foo\n\n"); let stream = EventStream::from(iter(vec![Event::data("a"), Event::data("b")])); - assert_eq!(stream.into_string(), "data:a\n\ndata:b\n\n"); + assert_eq!(stream.into_string().replace(":\n\n", ""), "data:a\n\ndata:b\n\n"); let stream = EventStream::from(iter(vec![ - Event::data("a\n"), + Event::data("a\nb"), Event::data("b"), Event::data("c\n\nd"), Event::data("e"), ])); - assert_eq!(stream.into_string(), - "data:a\ndata:\n\ndata:b\n\ndata:c\ndata:\ndata:d\n\ndata:e\n\n"); + assert_eq!(stream.into_string().replace(":\n\n", ""), + "data:a\ndata:b\n\ndata:b\n\ndata:c\ndata:\ndata:d\n\ndata:e\n\n"); } #[test]