You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: truncate.rs
    path of file: ./repos/databend/src/query/service/tests/it/storages/fuse/operations
    
    the code of the file until where you have to start completion: // Copyright 2022 Datafuse Labs.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE
    
async fn test_fuse_table_truncate() -> databend_common_exception::Result<()> {
    let fixture = TestFixture::setup().await?;
    let ctx = fixture.new_query_ctx().await?;

    fixture.create_default_database().await?;
    fixture.create_default_table().await?;

    let table = fixture.latest_default_table().await?;

    // 1. truncate empty table
    let prev_version = table.get_table_info().ident.seq;
    let r = table.truncate(ctx.clone()).await;
    let table = fixture.latest_default_table().await?;
    // no side effects
    assert_eq!(prev_version, table.get_table_info().ident.seq);
    assert!(r.is_ok());

    // 2. truncate table which has data
    let num_blocks = 10;
    let rows_per_block = 3;
    let value_start_from = 1;
    let stream =
        TestFixture::gen_sample_blocks_stream_ex(num_blocks, rows_per_block, value_start_from);

    let blocks = stream.try_collect().await?;
    fixture
        .append_commit_blocks(table.clone(), blocks, false, true)
        .await?;

    let source_plan = table.read_plan(ctx.clone(), None, true).await?;

    // get the latest tbl
    let prev_version = table.get_table_info().ident.seq;
    let table = fixture.latest_default_table().await?;
    assert_ne!(prev_version, table.get_table_info().ident.seq);

    // ensure data ingested
    let (stats, _) = table
        .read_partitions(ctx.clone(), source_plan.push_downs.clone(), true)
        .await?;
    assert_eq!(stats.read_rows, (num_blocks * rows_per_block));

    // truncate
    let r = table.truncate(ctx.clone()).await;
    assert!(r.is_ok());

    // get the latest tbl
    let prev_version = table.get_table_info().ident.seq;
    let table = fixture.latest_default_table().await?;
    assert_ne!(prev_version, table.get_table_info().ident.seq);
    let (stats, parts) = table
        .read_partitions(ctx.clone(), source_plan.push_downs.clone(), true)
        .await?;
    // cleared?
    assert_eq!(parts.len(), 0);
    assert_eq!(stats.read_rows, 0);

    Ok(())
}