Test that no additional flushes are called after pong flush success

This commit is contained in:
Alex Butler 2023-12-02 01:48:31 +00:00 committed by Daniel Abramov
parent 2d5b3e18de
commit 9f0af2a2e3
1 changed files with 6 additions and 0 deletions

View File

@ -121,4 +121,10 @@ fn read_usage_auto_pong_flush() {
assert_eq!(ws.get_ref().write_calls, 1);
assert_eq!(ws.get_ref().flush_calls, 3);
assert!(ws.get_ref().flushed_data == written_data, "Unexpected {:?}", ws.get_ref());
// On following read calls no additional writes or flushes are necessary
ws.read().unwrap_err();
assert_eq!(ws.get_ref().read_calls, 5);
assert_eq!(ws.get_ref().write_calls, 1);
assert_eq!(ws.get_ref().flush_calls, 3);
}