mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
test(app): reproduce prompt directory link failures
Retain the reported prompt-link cases and preserve literal filename endings while diagnosis awaits a directory-opening decision. Co-authored-by: guhyun9454 <127847761+guhyun9454@users.noreply.github.com>
This commit is contained in:
co-authored by
guhyun9454
parent
cafa04d3fb
commit
8938a305ca
@@ -2,6 +2,23 @@ import { describe, expect, it } from "vitest";
|
||||
import { detectTerminalLocalLinks } from "./terminal-local-link-parsing";
|
||||
|
||||
describe("detectTerminalLocalLinks", () => {
|
||||
it.each([
|
||||
["user@host:~/projects$ ls", 10, "~/projects"],
|
||||
["root@host:/etc/nginx# ", 10, "/etc/nginx"],
|
||||
["user@host ~/src% ", 10, "~/src"],
|
||||
])("excludes the prompt marker in %s", (line, index, text) => {
|
||||
expect(detectTerminalLocalLinks(line)).toMatchObject([
|
||||
{ path: { index, text }, suffix: undefined },
|
||||
]);
|
||||
});
|
||||
|
||||
it.each(["$", "#", "%"])("preserves a filename ending in %s", (marker) => {
|
||||
const path = `/tmp/report${marker}`;
|
||||
expect(detectTerminalLocalLinks(`cat ${path}`)).toMatchObject([
|
||||
{ path: { index: 4, text: path }, suffix: undefined },
|
||||
]);
|
||||
});
|
||||
|
||||
it("detects VS Code-style filename and line suffixes", () => {
|
||||
expect(detectTerminalLocalLinks("file.ts:42")).toMatchObject([
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user