Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/acp-utils/tests/client_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ async fn v2_initialization_accessors_expose_agent_metadata() -> Result<(), TestE
assert_eq!(client.agent_name(), "Display Name");
assert!(client.prompt_capabilities().is_some());
assert!(client.session_capabilities().is_some());
assert!(client.auth_methods().is_empty());
assert_eq!(client.auth_methods(), []);
client.handle.disconnect().await;
Ok(())
})
Expand Down
4 changes: 2 additions & 2 deletions crates/acp-utils/tests/client_turns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ async fn prompts_and_resumes_do_not_gate_requests() {
let first = fake.submit("one").await;
let second = fake.submit("one").await;
fake.client.handle.request(CloseSessionRequest::new("saved")).await.unwrap();
assert!(fake.client.handle.request(ListSessionsRequest::new()).await.unwrap().sessions.is_empty());
assert_eq!(fake.client.handle.request(ListSessionsRequest::new()).await.unwrap().sessions.len(), 0);
let resume = fake.resume("two", true);
let (_, responder) = fake.resumes.recv().await.unwrap();
assert!(fake.client.handle.request(ListSessionsRequest::new()).await.unwrap().sessions.is_empty());
assert_eq!(fake.client.handle.request(ListSessionsRequest::new()).await.unwrap().sessions.len(), 0);
for replay in [false, true] {
let other = fake.resume("other", replay);
let (_, responder) = fake.resumes.recv().await.unwrap();
Expand Down
12 changes: 6 additions & 6 deletions crates/acp-utils/tests/conversation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn remote_user_resources_render_as_references_but_keep_their_blocks() {
fn user_messages_appear_once_the_agent_inserts_them_and_are_keyed_by_message_id() {
let mut conversation = Conversation::new();
conversation.apply_event(&running());
assert!(conversation.items().is_empty());
assert_eq!(conversation.items(), []);

conversation.apply_event(&user_message("user", "prompt"));
conversation.apply_event(&user_message("user", "prompt"));
Expand Down Expand Up @@ -117,8 +117,8 @@ fn first_tool_update_creates_and_later_patches_replace_or_clear() {
acp::ToolCallUpdate::new("tool").title(MaybeUndefined::Null).raw_input(MaybeUndefined::Null),
));
assert_eq!(conversation.items().len(), 1);
assert!(tool(&conversation, 0).title().is_empty());
assert!(tool(&conversation, 0).raw_input().is_empty());
assert_eq!(tool(&conversation, 0).title(), "");
assert_eq!(tool(&conversation, 0).raw_input(), "");
}

#[test]
Expand All @@ -133,7 +133,7 @@ fn tool_content_chunks_append_but_updates_replace() {
assert_eq!(tool(&conversation, 0).content().len(), 1);

conversation.apply_event(&tool_update(acp::ToolCallUpdate::new("tool").content(MaybeUndefined::Null)));
assert!(tool(&conversation, 0).content().is_empty());
assert_eq!(tool(&conversation, 0).content(), []);
}

#[test]
Expand Down Expand Up @@ -337,7 +337,7 @@ fn activity_after_the_turn_ends_is_ignored_until_the_next_turn() {
conversation.apply_event(&compaction(acp::CompactionStatus::InProgress));

assert_eq!(conversation.activity(), Activity::Idle);
assert!(tool(&conversation, 0).sub_agents.is_empty());
assert_eq!(tool(&conversation, 0).sub_agents, []);
assert!(!conversation.is_compacting());

conversation.apply_event(&running());
Expand Down Expand Up @@ -390,7 +390,7 @@ fn clear_replaces_identity_and_resets_everything() {
conversation.clear();

assert_ne!(conversation.id(), previous_id);
assert!(conversation.items().is_empty());
assert_eq!(conversation.items(), []);
assert!(conversation.turn().is_idle(), "a running turn ends with the conversation");
assert!(conversation.plan().is_none());
assert!(conversation.context_usage().is_none());
Expand Down
2 changes: 1 addition & 1 deletion crates/aether-cli/src/acp/session/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ mod tests {
dispatch_event(&cx, McpClientEvent::ServerStatusesChanged(vec![]));

let McpNotification::ServerStatus { servers } = peer.next_mcp_notification().await;
assert!(servers.is_empty());
assert_eq!(servers.len(), 0);
})
.await;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/aether-cli/src/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ mod tests {
fn select_forwarded_vars_excludes_unknown() {
let vars = vec![("HOME".to_string(), "/root".to_string()), ("EDITOR".to_string(), "vim".to_string())];
let forwarded = select_forwarded_vars(vars.into_iter());
assert!(forwarded.is_empty());
assert_eq!(forwarded.len(), 0);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/aether-cli/src/workspace/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ mod tests {
git(&clone, &["commit", "-m", "diverge"]);

let original = root_commit_hash(&repo).unwrap();
assert!(!original.is_empty());
assert_ne!(original, "");
assert_eq!(root_commit_hash(&clone).unwrap(), original);
}

Expand Down
4 changes: 2 additions & 2 deletions crates/aether-cli/src/workspace/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ mod tests {
registry.register("old", &a).unwrap();
registry.register("new", &a).unwrap();

assert!(registry.workspaces_for("old").unwrap().is_empty());
assert_eq!(registry.workspaces_for("old").unwrap().len(), 0);
assert_eq!(registry.workspaces_for("new").unwrap().len(), 1);
}

Expand All @@ -169,6 +169,6 @@ mod tests {
#[test]
fn missing_registry_file_lists_empty() {
let (_dir, registry) = temp_registry();
assert!(registry.workspaces_for("repo1").unwrap().is_empty());
assert_eq!(registry.workspaces_for("repo1").unwrap().len(), 0);
}
}
2 changes: 1 addition & 1 deletion crates/aether-cli/tests/integration/acp_git_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async fn git_diff_refresh_tracks_scope_and_reports_status_ref() {
.block_task()
.await
.expect("status succeeds");
assert!(!status.display_dir.is_empty());
assert_ne!(status.display_dir, "");
})
.await;
}
Expand Down
8 changes: 4 additions & 4 deletions crates/aether-cli/tests/integration/acp_prompt_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ async fn prompt_search_request_searches_user_text_only() {
vec![llm::ContentBlock::text("first block"), llm::ContentBlock::text("second block")],
);

assert!(search(&harness, "agent").await.results.is_empty());
assert!(search(&harness, "aW1n").await.results.is_empty());
assert_eq!(search(&harness, "agent").await.results.len(), 0);
assert_eq!(search(&harness, "aW1n").await.results.len(), 0);

let multi = search(&harness, "second").await;
assert_eq!(multi.results.len(), 1);
Expand Down Expand Up @@ -66,7 +66,7 @@ async fn prompt_search_request_uses_literal_smart_case_unicode_matching() {
assert!(lower.results.iter().any(|hit| hit.prompt == "HELLO world"));

let upper = search(&harness, "Hello").await;
assert!(upper.results.is_empty());
assert_eq!(upper.results.len(), 0);

let unicode = search(&harness, "fé").await;
assert_eq!(unicode.results.len(), 1);
Expand Down Expand Up @@ -102,7 +102,7 @@ async fn prompt_search_request_with_empty_query_returns_no_results() {
harness.append_stored_prompt("s1", "cached alpha");

let response = search(&harness, "").await;
assert!(response.results.is_empty());
assert_eq!(response.results.len(), 0);
assert!(!response.truncated);
})
.await;
Expand Down
2 changes: 1 addition & 1 deletion crates/aether-cli/tests/integration/acp_remote/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn remote_client_parser_defaults_and_overrides() {
let args = ClientCli::try_parse_from(["client"]).unwrap().args;
assert_eq!(args.url, "ws://127.0.0.1:8765");
assert!(args.session.is_none());
assert!(args.headers.is_empty());
assert_eq!(args.headers.len(), 0);
assert!(args.log_dir.is_none());
let args = ClientCli::try_parse_from([
"client",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ async fn occupied_server_drops_non_websocket_request_without_detaching_owner() {
invalid.write_all(b"GET / HTTP/1.1\r\nHost: localhost\r\n\r\n").await.unwrap();
let mut response = Vec::new();
invalid.read_to_end(&mut response).await.unwrap();
assert!(response.is_empty());
assert_eq!(response.len(), 0);
assert_occupied(&server).await;
drop(owner);
server.shutdown().await;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async fn terminal_list_cursor_returns_an_empty_page() {
.to_string(),
);
let response = list(&harness, ListSessionsRequest::new().cursor(cursor)).await;
assert!(response.sessions.is_empty());
assert_eq!(response.sessions.len(), 0);
assert!(response.next_cursor.is_none());
})
.await;
Expand Down
6 changes: 3 additions & 3 deletions crates/aether-cli/tests/integration/run_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ fn assert_plan_tools(agent: &aether_project::AgentConfig) {
ToolMatcher::name("review__review_artifact"),
]
);
assert!(agent.tools.deny.is_empty());
assert_eq!(agent.tools.deny.len(), 0);
}

fn assert_read_only_coding_tools(agent: &aether_project::AgentConfig) {
Expand All @@ -365,15 +365,15 @@ fn assert_read_only_coding_tools(agent: &aether_project::AgentConfig) {
ToolMatcher::name("tasks__*"),
]
);
assert!(agent.tools.deny.is_empty());
assert_eq!(agent.tools.deny.len(), 0);
}

fn assert_minimal_mcp_and_tools(agent: &aether_project::AgentConfig) {
let McpSourceSpec::Inline { servers } = &agent.mcps[0] else { panic!("minimal MCPs should be inline") };
let names: Vec<&str> = servers.keys().map(String::as_str).collect();
assert_eq!(names, vec!["coding", "skills"]);
assert_eq!(agent.tools.allow, vec![ToolMatcher::name("coding__bash"), ToolMatcher::name("skills__*")]);
assert!(agent.tools.deny.is_empty());
assert_eq!(agent.tools.deny.len(), 0);
}

fn assert_contains_all(args: &[String], expected: &[&str], context: &str) {
Expand Down
6 changes: 3 additions & 3 deletions crates/aether-core/src/agent_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ mod tests {
deny: vec![],
};
let tools = vec![make_annotated_tool("read", ToolAnnotations::read_only())];
assert!(filter.apply(tools).is_empty());
assert_eq!(filter.apply(tools).len(), 0);
}

#[test]
Expand All @@ -288,7 +288,7 @@ mod tests {
"coding__read_file",
ToolAnnotations { read_only_hint: Some(true), ..ToolAnnotations::default() },
)];
assert!(filter.apply(tools).is_empty());
assert_eq!(filter.apply(tools).len(), 0);
}

#[test]
Expand All @@ -314,7 +314,7 @@ mod tests {
"coding__grep",
ToolAnnotations { read_only_hint: Some(true), ..ToolAnnotations::default() },
)];
assert!(filter.apply(tools).is_empty());
assert_eq!(filter.apply(tools).len(), 0);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/aether-core/src/mcp/mcp_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ mod tests {
updates.changed().await.expect("connection publishes a snapshot");
let observed = updates.borrow().clone();

assert!(old.tool_definitions().is_empty());
assert_eq!(old.tool_definitions().len(), 0);
assert_eq!(ready.tool_definitions()[0].name, "test__add_numbers");
assert_eq!(observed.tool_definitions(), ready.tool_definitions());
assert!(!Arc::ptr_eq(&old, &ready));
Expand Down
8 changes: 4 additions & 4 deletions crates/aether-core/tests/mcp/oauth_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ async fn builder_with_oauth_handler_factory_spawns_successfully() {
.unwrap();
let snapshot = spawn.block_until_ready().await.expect("bootstrap completes");

assert!(snapshot.tool_definitions().is_empty());
assert_eq!(snapshot.tool_definitions().len(), 0);
assert!(snapshot.model_instructions().is_empty());
}

Expand Down Expand Up @@ -221,7 +221,7 @@ async fn add_mcps_continues_on_oauth_failure() {
.await
.is_ok()
);
assert!(manager.tool_definitions().is_empty());
assert_eq!(manager.tool_definitions().len(), 0);
}

#[tokio::test]
Expand Down Expand Up @@ -269,7 +269,7 @@ async fn deferred_server_with_failing_http_surfaces_failure() {
let local_status = statuses.iter().find(|s| s.name == "local").expect("Expected status entry for 'local'");
assert!(matches!(local_status.status, McpServerStatus::Connected { .. }));
assert!(local_status.deferred_tools);
assert!(manager.tool_definitions().is_empty());
assert_eq!(manager.tool_definitions().len(), 0);
}

#[tokio::test]
Expand Down Expand Up @@ -304,7 +304,7 @@ async fn deferred_tools_partial_connection_works() {

let _ = manager.add_mcps(servers).await;

assert!(manager.tool_definitions().is_empty());
assert_eq!(manager.tool_definitions().len(), 0);
let statuses = manager.server_statuses();
assert!(matches!(
statuses.iter().find(|status| status.name == "working").unwrap().status,
Expand Down
2 changes: 1 addition & 1 deletion crates/aether-core/tests/mcp/task_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ async fn expired_task_terminates_before_polling() {

assert_eq!(notification.status, "failed");
assert!(notification.body.contains("expired before completion"));
assert!(state.task_get_ids().is_empty());
assert_eq!(state.task_get_ids().len(), 0);
}

#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion crates/aether-lspd/src/diagnostics_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,6 @@ mod tests {
let uri: Uri = "file:///test.rs".parse().unwrap();
store.publish(diagnostics(uri.as_str(), "error"));
store.forget_uri(&uri);
assert!(store.get(Some(&uri)).is_empty());
assert_eq!(store.get(Some(&uri)).len(), 0);
}
}
4 changes: 2 additions & 2 deletions crates/aether-lspd/src/document_lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ mod tests {

let filtered = lifecycle
.filter_watcher_changes(vec![FileEvent { uri: uri.clone(), typ: lsp_types::FileChangeType::CHANGED }]);
assert!(filtered.is_empty());
assert_eq!(filtered.len(), 0);
assert!(matches!(lifecycle.release(&uri), ReleaseAction::CloseAndRefresh));
}

Expand All @@ -246,7 +246,7 @@ mod tests {

let filtered = lifecycle
.filter_watcher_changes(vec![FileEvent { uri: uri.clone(), typ: lsp_types::FileChangeType::CHANGED }]);
assert!(filtered.is_empty());
assert_eq!(filtered.len(), 0);
assert!(matches!(lifecycle.release(&uri), ReleaseAction::Unchanged));
assert!(matches!(lifecycle.release(&uri), ReleaseAction::CloseAndRefresh));
}
Expand Down
2 changes: 1 addition & 1 deletion crates/aether-lspd/src/file_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ mod tests {
actor.accumulate_event(&notify_event(MODIFY_CONTENT, vec!["/tmp/project/src/main.rs"]));
actor.flush_pending().await;
let batch = event_rx.recv().await.expect("expected file watcher batch");
assert!(batch.forwarded_changes.is_empty());
assert_eq!(batch.forwarded_changes.len(), 0);
assert_eq!(batch.discovered_uris.len(), 1);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/aether-lspd/tests/e2e/e2e_lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async fn multiple_clients_share_fake_server_session() {
let hover1 = hover_text(client1.hover(uri.clone(), 0, 0).await.expect("Hover failed"));
let hover2 = hover_text(client2.hover(uri.clone(), 0, 0).await.expect("Hover failed"));

assert!(!hover1.is_empty());
assert_ne!(hover1, "");
assert_eq!(hover1, hover2);

harness.kill().await.expect("Failed to kill daemon");
Expand Down
2 changes: 1 addition & 1 deletion crates/aether-lspd/tests/e2e_smoke_real.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async fn rust_analyzer_smoke_hover() {
let uri = project.file_uri("src/main.rs");

let hover = hover_text(client.hover(uri, 0, 0).await.expect("Hover failed"));
assert!(!hover.is_empty());
assert_ne!(hover, "");

harness.kill().await.expect("Failed to kill daemon");
}
4 changes: 2 additions & 2 deletions crates/aether-project/src/aether_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -972,8 +972,8 @@ mod tests {

settings.inline_resources(project.root()).unwrap();

assert!(settings.prompts.is_empty());
assert!(settings.mcps.is_empty());
assert_eq!(settings.prompts.len(), 0);
assert_eq!(settings.mcps.len(), 0);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/aether-project/src/prompt_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ mod tests {

let parsed = PromptFile::parse(&dir.root().join("old-skill").join(SKILL_FILENAME)).unwrap();
assert_eq!(parsed.description, "An old skill");
assert!(parsed.tags.is_empty());
assert_eq!(parsed.tags.len(), 0);
assert!(!parsed.agent_authored);
assert_eq!(parsed.helpful, 0);
assert_eq!(parsed.harmful, 0);
Expand Down
12 changes: 6 additions & 6 deletions crates/aether-sessions/tests/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ fn prompt_search_is_smart_case_unicode_safe_and_retains_recent_entries() {
store.append("session-1", &user_message("café"));

let old = store.store().search_prompts("prompt 0", None).expect("search succeeds");
assert!(old.results.is_empty());
assert_eq!(old.results.len(), 0);

let lower = store.store().search_prompts("hello", None).expect("search succeeds");
assert_eq!(lower.results.len(), 1);
let upper = store.store().search_prompts("Hello", None).expect("search succeeds");
assert!(upper.results.is_empty());
assert_eq!(upper.results.len(), 0);
let unicode = store.store().search_prompts("fé", None).expect("search succeeds");
let hit = &unicode.results[0];
assert_eq!(&hit.prompt[hit.match_start..hit.match_end], "fé");
Expand Down Expand Up @@ -210,18 +210,18 @@ fn blank_runs_and_oversized_lines_consume_preview_budget() {

let preview = store.store().preview("session-1").expect("preview succeeds");
assert!(preview.truncated);
assert!(preview.transcript.is_empty());
assert_eq!(preview.transcript.len(), 0);
}

#[test]
fn empty_and_missing_stores_have_no_sessions_or_prompts() {
let store = TestStore::new();
assert!(store.store().list().is_empty());
assert_eq!(store.store().list().len(), 0);
let missing_session = store.store().load("missing").unwrap_err();
assert!(matches!(missing_session, SessionStoreError::Io(error) if error.kind() == std::io::ErrorKind::NotFound));
let empty = store.store().search_prompts(" ", None).expect("search succeeds");
assert!(empty.results.is_empty());
assert_eq!(empty.results.len(), 0);

let missing = SessionStore::from_path(store.path().join("missing"));
assert!(missing.list().is_empty());
assert_eq!(missing.list().len(), 0);
}
Loading
Loading