5 releases

0.1.8 Aug 17, 2024
0.1.6 Jul 25, 2024
0.1.5 Jul 25, 2024
0.1.4 Jul 25, 2024
0.1.3 Jul 25, 2024

#8 in #mark-down

MulanPSL-2.0

8KB
68 lines

tryn

use std::sync::atomic::{AtomicU8, Ordering};

use aok::{Result, OK};
use static_init::constructor;

#[constructor(0)]
extern "C" fn init() {
  loginit::init()
}

#[tokio::test]
async fn test() -> Result<()> {
  let n = AtomicU8::new(0);
  tryn::retry(|| async {
    let t = n.fetch_add(1, Ordering::SeqCst);
    if t == 0 {
      aok::throw!("test error");
    }
    Ok(())
  })
  .await?;

  OK
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

Dependencies

~545KB