use lsm_tree::{
    AbstractTree, Config, SeqNo, SequenceNumberCounter, config::BlockSizePolicy, get_tmp_folder,
};
use test_log::test;

#[test]
fn table_remove_weak_simple() -> lsm_tree::Result<()> {
    let folder = get_tmp_folder();

    let tree = Config::new(
        &folder,
        SequenceNumberCounter::default(),
        SequenceNumberCounter::default(),
    )
    .data_block_size_policy(BlockSizePolicy::all(1_024))
    // .index_block_size_policy(BlockSizePolicy::all(1_024))
    .open()?;

    tree.insert("a", "a", 0);
    tree.insert("a", "b", 1);
    tree.remove_weak("a", 2);

    tree.flush_active_memtable(0)?;

    assert!(tree.get("a", SeqNo::MAX)?.is_none());

    Ok(())
}
