// tests/limit_stress_test.rs
#![recursion_limit = "1024"]

use axioma::prelude::*;

#[test]
fn test_deep_recursion_limit() {
    // Init axioma macro.
    let matrix = axioma!({
        "layer_1": {
            "layer_2": {
                "layer_3": {
                    "layer_4": {
                        "layer_5": {
                            "layer_6": {
                                "layer_7": {
                                    "layer_8": {
                                        "layer_9": {
                                            "layer_10": "core_reached"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "wide_1": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
        "wide_2": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    });

    // Loop matrix.
    let mut found_core = false;
    for r in 0..20 {
        for c in 0..20 {
            // Check condition.
            if matrix(r, c).2 == AxiValue::Str("core_reached") {
                found_core = true;
                break;
            }
        }
    }
    assert!(found_core, "Failed to project deep topology!");
}
