dqhl76 commented on code in PR #2644: URL: https://github.com/apache/incubator-opendal/pull/2644#discussion_r1263670505
########## core/tests/behavior/write.rs: ########## @@ -1233,3 +1234,31 @@ pub async fn test_fuzz_unsized_writer(op: Operator) -> Result<()> { op.delete(&path).await.expect("delete must succeed"); Ok(()) } + +/// seeking a negative position should return a InvalidInput error +pub async fn test_invalid_reader_seek(op: Operator) -> Result<()> { + let path = uuid::Uuid::new_v4().to_string(); + debug!("Generate a random file: {}", &path); + let (content, _) = gen_bytes(); + + op.write(&path, content.clone()) + .await + .expect("write must succeed"); + + let mut r = op.reader(&path).await?; + let res = r.seek(std::io::SeekFrom::Current(-1024)).await; + + assert!(res.is_err()); Review Comment: https://github.com/apache/incubator-opendal/pull/2644#discussion_r1263578549 Please check this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@opendal.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org