diff --git a/test_tui.c b/test_tui.c index 8b04f21..6b27d40 100644 --- a/test_tui.c +++ b/test_tui.c @@ -871,7 +871,7 @@ void test_paste_clips(void) { assert(row_offset == 2); assert(col_offset == 2); - // Simulate paste: trigger clip at new position + // Simulate paste: trigger clip twice to go empty -> recording -> stopped int new_row = first_yanked_row + row_offset; int new_col = first_yanked_col + col_offset; int new_clip_idx = new_row * 8 + new_col; @@ -880,9 +880,10 @@ void test_paste_clips(void) { assert(new_col == 3); assert(new_clip_idx == 27); + engine_trigger_clip(engine, new_clip_idx); engine_trigger_clip(engine, new_clip_idx); engine_process_commands(engine); - assert(engine->clips[27].state == CLIP_RECORDING); + assert(engine->clips[27].state == CLIP_STOPPED); destroy_test_engine(engine); printf("PASSED\n"); diff --git a/tui.c b/tui.c index 99411d0..2036558 100644 --- a/tui.c +++ b/tui.c @@ -165,6 +165,8 @@ static void paste_clips(void) { // Bounds check if (new_row >= 0 && new_row < GRID_ROWS && new_col >= 0 && new_col < GRID_COLS) { int new_clip_idx = grid_to_clip_index(new_row, new_col); + // Trigger twice to go from empty -> recording -> stopped + engine_trigger_clip(g_engine, new_clip_idx); engine_trigger_clip(g_engine, new_clip_idx); } }