Skip to content

Commit bf54c72

Browse files
committed
Run clipboard-based tests serially
Since the clipboard contains shared/global state, these tests can overwrite each other's content, causing intermittent failures.
1 parent cf76c2d commit bf54c72

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/commands/buffer.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ mod tests {
984984
use crate::models::Application;
985985
use scribe::buffer::Position;
986986
use scribe::Buffer;
987+
use serial_test::serial;
987988
use std::env;
988989
use std::fs::File;
989990
use std::io::Write;
@@ -1589,6 +1590,7 @@ mod tests {
15891590
}
15901591

15911592
#[test]
1593+
#[serial]
15921594
fn paste_inserts_at_cursor_when_pasting_inline_data() {
15931595
let mut app = Application::new(&Vec::new()).unwrap();
15941596
let mut buffer = Buffer::new();
@@ -1611,6 +1613,7 @@ mod tests {
16111613
}
16121614

16131615
#[test]
1616+
#[serial]
16141617
fn paste_inserts_on_line_below_when_pasting_block_data() {
16151618
let mut app = Application::new(&Vec::new()).unwrap();
16161619
let mut buffer = Buffer::new();
@@ -1633,6 +1636,7 @@ mod tests {
16331636
}
16341637

16351638
#[test]
1639+
#[serial]
16361640
fn paste_works_at_end_of_buffer_when_pasting_block_data() {
16371641
let mut app = Application::new(&Vec::new()).unwrap();
16381642
let mut buffer = Buffer::new();
@@ -1656,6 +1660,7 @@ mod tests {
16561660
}
16571661

16581662
#[test]
1663+
#[serial]
16591664
fn paste_works_on_trailing_newline_when_pasting_block_data() {
16601665
let mut app = Application::new(&Vec::new()).unwrap();
16611666
let mut buffer = Buffer::new();
@@ -1838,6 +1843,7 @@ mod tests {
18381843
}
18391844

18401845
#[test]
1846+
#[serial]
18411847
fn paste_with_inline_content_replaces_selection() {
18421848
let mut app = Application::new(&Vec::new()).unwrap();
18431849
let mut buffer = Buffer::new();
@@ -1865,6 +1871,7 @@ mod tests {
18651871
}
18661872

18671873
#[test]
1874+
#[serial]
18681875
fn paste_with_block_content_replaces_selection() {
18691876
let mut app = Application::new(&Vec::new()).unwrap();
18701877
let mut buffer = Buffer::new();
@@ -1891,6 +1898,7 @@ mod tests {
18911898
}
18921899

18931900
#[test]
1901+
#[serial]
18941902
fn paste_above_inserts_clipboard_contents_on_a_new_line_above() {
18951903
let mut app = Application::new(&Vec::new()).unwrap();
18961904
let mut buffer = Buffer::new();

0 commit comments

Comments
 (0)