mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-24 18:52:29 -07:00
docs: remove TDD notes and irrelevant comments from policy tests
This commit is contained in:
@@ -111,7 +111,7 @@ priority = 100
|
||||
expect(result.errors).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('should match if ^ is used in commandRegex (TDD: currently fails)', async () => {
|
||||
it('should match if ^ is used in commandRegex', async () => {
|
||||
const result = await runLoadPoliciesFromToml(`
|
||||
[[rule]]
|
||||
toolName = "run_shell_command"
|
||||
@@ -121,7 +121,7 @@ priority = 100
|
||||
`);
|
||||
|
||||
expect(result.rules).toHaveLength(1);
|
||||
// After the fix, this should match correctly
|
||||
// The generated pattern is "command":"^git status
|
||||
expect(
|
||||
result.rules[0].argsPattern?.test('{"command":"git status"}'),
|
||||
).toBe(true);
|
||||
|
||||
@@ -145,16 +145,15 @@ describe('policy/utils', () => {
|
||||
});
|
||||
|
||||
describe('commandRegex anchors', () => {
|
||||
it('should transform ^ anchor correctly (TDD: currently failing to match)', () => {
|
||||
it('should transform ^ anchor correctly', () => {
|
||||
const patterns = buildArgsPatterns(undefined, undefined, '^git status');
|
||||
const regex = new RegExp(patterns[0]!);
|
||||
// JSON stringified command: {"command":"git status"}
|
||||
const json = '{"command":"git status"}';
|
||||
// This CURRENTLY fails because the pattern is "command":"^git status
|
||||
expect(regex.test(json)).toBe(true);
|
||||
});
|
||||
|
||||
it('should transform $ anchor correctly (TDD: currently failing to match)', () => {
|
||||
it('should transform $ anchor correctly', () => {
|
||||
const patterns = buildArgsPatterns(
|
||||
undefined,
|
||||
undefined,
|
||||
@@ -162,11 +161,10 @@ describe('policy/utils', () => {
|
||||
);
|
||||
const regex = new RegExp(patterns[0]!);
|
||||
const json = '{"command":"tmux send-keys -t superpowers:6 C-c"}';
|
||||
// This CURRENTLY fails because $ matches end of JSON string, not end of command value
|
||||
expect(regex.test(json)).toBe(true);
|
||||
});
|
||||
|
||||
it('should handle $ anchor when other fields follow (TDD: currently failing)', () => {
|
||||
it('should handle $ anchor when other fields follow', () => {
|
||||
const patterns = buildArgsPatterns(undefined, undefined, 'git status$');
|
||||
const regex = new RegExp(patterns[0]!);
|
||||
const json = '{"command":"git status","dir_path":"/tmp"}';
|
||||
|
||||
Reference in New Issue
Block a user