#[test]
fn test_shrine_redistribution_bug() {
    let shrine: IShrineDispatcher = shrine_utils::shrine_setup_with_feed(Option::None);

    // Manually set up troves so that all troves uses just yang1
    let yangs: Span<ContractAddress> = shrine_utils::three_yang_addrs_reversed();
    let yang_addr = *yangs.at(1); // select the middle one

    let forge_amt: u128 = 1_000_000_000_000_000_000_000;

    // Set up trove1 with some yang and some debt
    let trove1_owner = common::trove1_owner_addr();
    let redistributed_trove: u64 = common::TROVE_1;
    start_prank(CheatTarget::All, shrine_utils::admin());
    shrine.deposit(yang_addr, redistributed_trove, shrine_utils::TROVE1_YANG1_DEPOSIT.into());
    shrine.forge(trove1_owner, redistributed_trove, forge_amt.into(), 0_u128.into());

    // Set up trove1 with some yang and some debt
    let trove2_owner = common::trove2_owner_addr();
    let recipient_trove: u64 = common::TROVE_2;
    shrine.deposit(yang_addr, recipient_trove, shrine_utils::TROVE1_YANG1_DEPOSIT.into());
    shrine.forge(trove2_owner, recipient_trove, forge_amt.into(), 0_u128.into());

    println!("before:");
    println!(" trove1 yang={}", shrine.get_deposit(yang_addr, redistributed_trove).val);
    println!(" trove2 yang={}", shrine.get_deposit(yang_addr, recipient_trove).val);
    println!(" total yang: {}", shrine.get_yang_total(yang_addr));

    // Simulate complete redistribution of trove1
    shrine.redistribute(redistributed_trove, trove1_health.debt, RAY_ONE.into());

    println!("after:");
    println!(" trove1 yang={}", shrine.get_deposit(yang_addr, redistributed_trove).val);
    println!(" trove2 yang={}", shrine.get_deposit(yang_addr, recipient_trove).val);
    println!(" total yang: {}", shrine.get_yang_total(yang_addr));

    shrine_utils::assert_shrine_invariants(shrine, yangs, 2);
}
before:
trove1 yang=5000000000000000000
trove2 yang=5000000000000000000
trove1 value=2895610636113415002820 ltv=345350299355935952856010534 debt=1000000000000000000000
trove2 value=2895610636113415002820 ltv=345350299355935952856010534 debt=1000000000000000000000

after:
trove1 yang=5000000000000000000
trove2 yang=5000000000000000000
trove1 value=2895610636113415002820 ltv=0 debt=0
trove2 value=2895610636113415002820 ltv=690700598711871905712021068 debt=2000000000000000000000
after:
trove1 yang=0
trove2 yang=5000000000000000000
trove1 value=0 ltv=0 debt=0
trove2 value=2895610636113415002820 ltv=690700598711871905712021068 debt=2000000000000000000000
