Skip to content

[Feature]: Add automated test coverage for clink_vfox.lua #728

Closed

Description

@linghengqian

1. Your usage scenarios?

internal/shell/clink_vfox.lua (Clink completion/startup script) currently has zero automated coverage. Changes like #724 can only be verified by manual testing on Windows/Clink: neither the windows-regressions CI job (env path format, TestOpenSkipsVfoxShim, TestInstall) nor any Go test exercises the script, unlike Fish/Bash/Zsh completions which have integration tests in cmd/completion_test.go. This means regressions in vfox available / vfox ls output parsing or per-command completions (use/unuse/exec/info/remove/env flags) go unnoticed until a user hits them.

2. What is your expected outcome?

Add a gopher-lua-based unit test (e.g. internal/shell/clink_test.go, the repo already depends on github.com/yuin/gopher-lua) that loads clink_vfox.lua with stubbed clink.argmatcher, io.popen, io.open, and os.setenv/getenv, feeds canned vfox available / vfox ls outputs (including tree glyphs └ ─ ├ │ ┬ and ✓/✗ markers), and asserts the resulting completion lists for use/unuse/exec/info/remove/env. This runs inside the existing go test ./... matrix (which already includes windows-latest), so no new CI job or real Clink installation is needed. Optionally add golden tests locking the vfox available (two-space prefix) and vfox ls tree output formats the script depends on. Ref: #724.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions