aports/testing/rio/test.patch
2025-03-09 14:49:56 +00:00

82 lines
2.4 KiB
Diff

Disable flaky test
--- a/frontends/rioterm/src/context/title.rs 2025-03-02 08:45:43.178100398 +0100
+++ b/frontends/rioterm/src/context/title.rs 2025-03-02 08:47:31.054308292 +0100
@@ -276,78 +266,4 @@ pub mod test {
// String::from("")
// );
}
-
- #[test]
- fn test_update_title_with_logical_or() {
- let context_dimension = ContextDimension::build(
- 1200.0,
- 800.0,
- SugarDimensions {
- scale: 2.,
- width: 18.,
- height: 9.,
- },
- 1.0,
- Delta::<f32>::default(),
- );
-
- assert_eq!(context_dimension.columns, 66);
- assert_eq!(context_dimension.lines, 88);
-
- let rich_text_id = 0;
- let route_id = 0;
- let context = create_mock_context(
- VoidListener {},
- WindowId::from(0),
- route_id,
- rich_text_id,
- context_dimension,
- );
- assert_eq!(update_title("", &context), String::from(""));
- // Title always starts empty
- assert_eq!(update_title("{{title}}", &context), String::from(""));
-
- assert_eq!(
- update_title("{{ title || columns }}", &context),
- String::from("66")
- );
-
- assert_eq!(
- update_title("{{ title || title }}", &context),
- String::from("")
- );
-
- // let's modify title to actually be something
- {
- let mut term = context.terminal.lock();
- term.title = "Something".to_string();
- };
-
- assert_eq!(
- update_title("{{ title || columns }}", &context),
- String::from("Something")
- );
-
- assert_eq!(
- update_title("{{ columns || title }}", &context),
- String::from("66")
- );
-
- assert_eq!(
- update_title("{{ absolute_path || title }}", &context),
- String::from("Something")
- );
-
- // let's modify current_directory to actually be something
- {
- let path = std::path::PathBuf::from("/tmp");
- let mut term = context.terminal.lock();
- term.current_directory = Some(path);
- };
-
- assert_eq!(
- update_title("{{ absolute_path || title }}", &context),
- String::from("/tmp"),
- );
- }
}