def test_grep_to_cmdrun_quotes(temp_dir, runtime_cls, run_as_openhands):
    """Test patterns with different types of quotes."""
    runtime, config = _load_runtime(temp_dir, runtime_cls, run_as_openhands)
    try:
        # Double quotes in pattern
        cmd = grep_to_cmdrun(r'const message = "Hello"', '/workspace')
        assert 'rg -li' in cmd

        # Verify command works by executing it on a test file
        setup_cmd = 'echo \'const message = "Hello";\' > /workspace/test_quotes.js'
        obs = _run_cmd_action(runtime, setup_cmd)
        assert obs.exit_code == 0

        obs = _run_cmd_action(runtime, cmd)
        assert obs.exit_code == 0
        assert '/workspace/test_quotes.js' in obs.content

        # Single quotes in pattern
        cmd = grep_to_cmdrun("function\\('test'\\)", '/workspace')
        assert 'rg -li' in cmd

        setup_cmd = 'echo "function(\'test\') {}" > /workspace/test_quotes2.js'
        obs = _run_cmd_action(runtime, setup_cmd)
        assert obs.exit_code == 0

        obs = _run_cmd_action(runtime, cmd)
        assert obs.exit_code == 0
        assert '/workspace/test_quotes2.js' in obs.content
    finally:
        _close_test_runtime(runtime)
Test patterns with different types of quotes.
tests/runtime/test_glob_and_grep.py