Hello, I always appreciate rulesync.
Problem
While copilot-rule.test.ts is fairly comprehensive at 1,133 lines, I found several edge cases that are not covered and could hide existing bugs.
Missing Test Cases
1. Complex comma-separated glob patterns in applyTo
The current test for applyTo splitting covers a simple single-pattern case. The following patterns are untested:
- Multiple patterns:
"src/**/*.ts,tests/**/*.test.ts"
- Patterns with surrounding whitespace:
"*.ts , *.js" (trimming)
- Duplicate patterns:
"*.ts,*.ts"
- Special characters:
"src/{components,utils}/**/*.ts"
2. excludeAgent: "code-review" roundtrip
Only excludeAgent: "coding-agent" is tested in roundtrip scenarios. The "code-review" value lacks equivalent coverage.
3. applyTo being undefined or empty string
The behavior when applyTo is absent or empty is not explicitly tested. Expected: globs should be undefined.
4. Global mode + non-root path combination
getSettablePaths({ global: true }) is tested for the root file, but the non-root path (.copilot/instructions/) is not verified.
5. YAML serialization of special characters in description
The description field is not tested with values containing quotes, newlines, or Markdown syntax (# Heading), which can affect YAML serialization behavior.
Reference
Similar patterns are tested in cursor-rule.test.ts (e.g., complex globs at line 391, empty globs at line 232–249), which may serve as a reference for what to add here.
Your consideration would be appreciated.
Hello, I always appreciate rulesync.
Problem
While
copilot-rule.test.tsis fairly comprehensive at 1,133 lines, I found several edge cases that are not covered and could hide existing bugs.Missing Test Cases
1. Complex comma-separated glob patterns in
applyToThe current test for
applyTosplitting covers a simple single-pattern case. The following patterns are untested:"src/**/*.ts,tests/**/*.test.ts""*.ts , *.js"(trimming)"*.ts,*.ts""src/{components,utils}/**/*.ts"2.
excludeAgent: "code-review"roundtripOnly
excludeAgent: "coding-agent"is tested in roundtrip scenarios. The"code-review"value lacks equivalent coverage.3.
applyTobeingundefinedor empty stringThe behavior when
applyTois absent or empty is not explicitly tested. Expected:globsshould beundefined.4. Global mode + non-root path combination
getSettablePaths({ global: true })is tested for the root file, but the non-root path (.copilot/instructions/) is not verified.5. YAML serialization of special characters in
descriptionThe
descriptionfield is not tested with values containing quotes, newlines, or Markdown syntax (# Heading), which can affect YAML serialization behavior.Reference
Similar patterns are tested in
cursor-rule.test.ts(e.g., complex globs at line 391, empty globs at line 232–249), which may serve as a reference for what to add here.Your consideration would be appreciated.