




















11// Command path match tests cover CLI command path matching and normalization.
22import { describe, expect, it } from "vitest";
3-import {
4-matchesCommandPath,
5-matchesCommandPathRule,
6-} from "./command-path-matches.js";
3+import { matchesCommandPath } from "./command-path-matches.js";
7485describe("command-path-matches", () => {
96it("matches prefix and exact command paths", () => {
@@ -13,28 +10,4 @@ describe("command-path-matches", () => {
1310expect(matchesCommandPath(["config", "get"], ["config", "get"], { exact: true })).toBe(true);
1411});
151216-it("matches declarative rules", () => {
17-expect(matchesCommandPathRule(["plugins", "update"], ["plugins"])).toBe(true);
18-expect(
19-matchesCommandPathRule(["plugins", "update"], {
20-pattern: ["plugins", "update"],
21-exact: true,
22-}),
23-).toBe(true);
24-expect(
25-matchesCommandPathRule(["plugins", "update", "now"], {
26-pattern: ["plugins", "update"],
27-exact: true,
28-}),
29-).toBe(false);
30-});
31-32-it("treats structured rules without exact as prefix matches", () => {
33-expect(
34-matchesCommandPathRule(["plugins", "update", "now"], {
35-pattern: ["plugins", "update"],
36-}),
37-).toBe(true);
38-});
39-4013});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。