use qubit_retry::{
AttemptCancelToken,
Retry,
};
use crate::support::TestError;
#[derive(Debug, PartialEq, Eq)]
struct NonCloneValue {
text: &'static str,
}
#[test]
fn test_blocking_value_operation_is_observable_through_non_clone_success_value() {
let retry = Retry::<TestError>::builder()
.max_attempts(1)
.no_delay()
.build()
.expect("retry should build");
let value = retry
.run_in_worker(|_token: AttemptCancelToken| {
Ok::<_, TestError>(NonCloneValue { text: "ok" })
})
.expect("worker operation should succeed");
assert_eq!(value, NonCloneValue { text: "ok" });
}