command_stream/commands/
pwd.rs1use crate::commands::CommandContext;
4use crate::utils::CommandResult;
5
6pub async fn pwd(ctx: CommandContext) -> CommandResult {
10 let path = ctx.get_cwd();
11 CommandResult::success(format!("{}\n", path.display()))
12}
13
14#[cfg(test)]
15mod tests {
16 use super::*;
17
18 #[tokio::test]
19 async fn test_pwd() {
20 let ctx = CommandContext::new(vec![]);
21 let result = pwd(ctx).await;
22 assert!(result.is_success());
23 assert!(!result.stdout.is_empty());
24 }
25}