Skip to content

Commit

Permalink
Complete a imcomplete test.
Browse files Browse the repository at this point in the history
  • Loading branch information
YoEight committed Aug 18, 2024
1 parent 11e9944 commit 64efba4
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions geth-client-tests/src/append_read_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,27 @@ async fn read_whole_stream_forward() -> eyre::Result<()> {
});
}

let mut stream = client
client
.append_stream(&stream_name, ExpectedRevision::Any, events.clone())
.await?;

let stream = client
.read_stream(&stream_name, Direction::Forward, Revision::Start, u64::MAX)
.await;

// TODO - forgot to complete that test!
let actuals = stream.try_collect::<Vec<_>>().await?;

assert_eq!(events.len(), actuals.len());

for i in 0..100 {
let expected = events.get(i).unwrap();
let actual = actuals.get(i).unwrap();

assert_eq!(expected.id, actual.id);
assert_eq!(expected.r#type, actual.r#type);
assert_eq!(expected.data, actual.data);
assert_eq!(stream_name, actual.stream_name);
}

Ok(())
}

0 comments on commit 64efba4

Please sign in to comment.