T40: a press whose record went, a twin Linux stacked or one past the 64 kept, still shows its session; on Linux the body goes as markup's text; only a command C started posts its end, so a prompt bash 3.2 draws again posts nothing; the posting conditions are pure and tested; the decision says what macOS, Wayland and gpui's log do at a press and outside the bundle
CI / platforms (ubuntu-24.04) (push) Successful in 1m29s
CI / platforms (windows-latest) (push) Successful in 1m34s
CI / macos (push) Successful in 14m7s

This commit is contained in:
ZacharyZhang-NY committed 2026-10-17 15:51:46 -04:00
1 parent efda50f142
commit 52576bb8ee
5 files changed
+98 -11

No files matched your search

+40
View File
@@ -81,3 +81,43 @@ fn a_notification_says_its_text_as_text() {
assert_eq!(finished(None), "Command finished");
assert_eq!(finished(Some(2)), "Command exited with 2");
}
#[test]
fn a_session_posts_unless_it_is_the_one_shown_in_an_active_window() {
assert!(!unseen(true, true));
assert!(unseen(true, false), "the window inactive");
assert!(unseen(false, true), "the session hidden");
assert!(unseen(false, false));
}
#[test]
fn waiting_done_and_error_post_and_work_and_rest_do_not() {
for (state, posts) in [
(State::Blocked, true),
(State::Done, true),
(State::Error, true),
(State::Working, false),
(State::Idle, false),
] {
assert_eq!(tells(state), posts, "{state:?}");
}
}
#[test]
fn a_tag_names_the_session_that_posted_it() {
for tag in ["12", "12:build", "12#3"] {
assert!(owns(12, tag), "{tag}");
}
for tag in ["123", "1", "123:build", "13#3", ""] {
assert!(!owns(12, tag), "{tag}");
}
}
#[test]
fn a_body_goes_as_markup_s_text() {
assert_eq!(
escape("<b>a</b> & <a href=x>"),
"&lt;b&gt;a&lt;/b&gt; &amp; &lt;a href=x&gt;"
);
assert_eq!(escape("plain"), "plain");
}