File size: 878 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#![allow(clippy::needless_return)] // tokio macro-generated code doesn't respect this

use turbo_tasks::debug::ValueDebugFormat;
use turbo_tasks_testing::{Registration, register, run};

static REGISTRATION: Registration = register!();

#[tokio::test]
async fn ignored_indexes() {
    #[allow(dead_code)]
    #[derive(ValueDebugFormat)]
    struct IgnoredIndexes(
        #[allow(dead_code)]
        #[turbo_tasks(debug_ignore)]
        i32,
        i32,
        #[allow(dead_code)]
        #[turbo_tasks(debug_ignore)]
        i32,
    );

    run(&REGISTRATION, || async {
        let input = IgnoredIndexes(-1, 2, -3);
        let debug = input.value_debug_format(usize::MAX).try_to_string().await?;
        assert!(!debug.contains("-1"));
        assert!(debug.contains('2'));
        assert!(!debug.contains("-3"));
        anyhow::Ok(())
    })
    .await
    .unwrap();
}