*** Settings ***
Documentation    Smoke tests for skill-level search and directory tools
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

*** Variables ***
${HELPER_SCRIPT}    robot/helper_skill_search.py

*** Test Cases ***
Skill List Dir
    [Documentation]    List directory using skill/list-dir
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    listdir    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    skill-listdir-ok

Skill Glob
    [Documentation]    Glob files using skill/glob
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    glob    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    skill-glob-ok

Skill Grep
    [Documentation]    Search files using skill/grep
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    grep    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    skill-grep-ok

Skill Search Path Traversal
    [Documentation]    Path traversal should be blocked
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    traversal    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    skill-search-traversal-ok
