chitralverma commented on PR #9378:
URL: https://github.com/apache/opendal/pull/9378#issuecomment-7256656978

   (AI-generated reply)
   
   Thanks, fixed in 22b46fe as a fixup commit. `main` has not moved since 
c275bf8, so the merge brought in nothing.
   
   The `range` doc in `include/options.hpp` now reads:
   
   > A `ReadRange::Range` whose `end` is not after `start` reads nothing. 
Otherwise, a `ReadRange::Range` whose `end` is past the end of the file fails 
the read.
   
   I reproduced your case on a build of 690a844 against a 10-byte file, on 
`memory` and `fs`:
   - `Range(11, 11)`, `Range(12, 11)`, and `Range(10, 10)` return an empty 
string.
   - `Range(2, 11)` and `Range(9, 11)` fail with `Unexpected` ("reader got too 
little data").
   - `Range(10, 11)`, `Range(10, 12)`, `Range(11, 12)`, `Range(20, 30)`, and 
`Range(100, 101)` fail with `RangeNotSatisfied`.
   - Each nonempty case fails both with and without `chunk = 4`.
   
   So the failure applies only to nonempty ranges, as the new "Otherwise" 
sentence says.
   
   Tests: `tests/options_test.cpp` now also checks on `memory` that `Range(11, 
11)` and `Range(12, 11)` read nothing and that `Range(2, 11)` and `Range(10, 
11)` throw. Scratch mutations confirmed that these checks can fail:
   - With the old joined sentence back in the generator, the doc test fails at 
"doc of `ReadOptions::range`". It also fails with only "Otherwise" removed.
   - With the generated conversion reading one byte for an empty `RANGE`, the 
C++ range test throws `RangeNotSatisfied` at `Range(11, 11)`.
   
   Checks on 22b46fe:
   - Every `ci_odev.yml` generator plus every binding's `cargo fmt`, then `git 
diff --exit-code`: clean.
   - `dev`: fmt, clippy `-D warnings`, and `cargo test` (146 passed).
   - `bindings/cpp`: clippy `-D warnings` and `cargo test` (18 passed).
   - `OPENDAL_DEV=ON` build with LLVM clang++: `opendal_cpp_test` passed 122 of 
122.
   
   The PR description now covers these cases.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to