Fix failing test because of race condition

By sorting the breakpoints based on the line number, the order does not matter.
This commit is contained in:
Remco Smits
2025-01-19 14:36:02 +01:00
parent 868f55c074
commit 5ecfef0aa0

View File

@@ -1040,16 +1040,10 @@ async fn test_updated_breakpoints_send_to_dap(
let called_set_breakpoints = called_set_breakpoints.clone();
move |_, args| {
assert_eq!("/a/test.txt", args.source.path.unwrap());
let mut breakpoints = args.breakpoints.unwrap();
breakpoints.sort_by_key(|b| b.line);
assert_eq!(
vec![
SourceBreakpoint {
line: 3,
column: None,
condition: None,
hit_condition: None,
log_message: None,
mode: None
},
SourceBreakpoint {
line: 2,
column: None,
@@ -1057,9 +1051,17 @@ async fn test_updated_breakpoints_send_to_dap(
hit_condition: None,
log_message: None,
mode: None
},
SourceBreakpoint {
line: 3,
column: None,
condition: None,
hit_condition: None,
log_message: None,
mode: None
}
],
args.breakpoints.unwrap()
breakpoints
);
assert!(!args.source_modified.unwrap());