<commit_before>*** Settings ***
Library           OperatingSystem

*** Test Cases ***
Tilde in path
    ${home}=    Get OS Independent Home Path
    ${normalized}=    Normalize Path    ~/foo
    Should Be Equal    ${normalized}    ${home}${/}foo
    Directory Should Exist    ~

Tilde and username in path
    ${user}=    Get OS Independent Username
    ${home}=    Get OS Independent Home Path
    ${normalized}=    Normalize Path    ~${user}/foo
    Should Be Equal    ${normalized}    ${home}${/}foo
    Directory Should Exist    ~${user}

*** Keywords ***
Get OS Independent Username
    ${username}=    Get Environment Variable    USERNAME    NotSet
    ${user}=    Get Environment Variable    USER    ${username}
    [Return]    ${user}

Get OS Independent Home Path
    ${homepath}=    Get Environment Variable    HOMEPATH    NotSet
    ${homedrive}=    Get Environment Variable    HOMEDRIVE    NotSet
    ${home}=    Get Environment Variable    HOME    ${homedrive}:${homepath}
    [Return]    ${home}<commit_msg>Fixed tilde expansion test on Windows.<commit_after>*** Settings ***
Library           OperatingSystem

*** Test Cases ***
Tilde in path
    ${home}=    Get OS Independent Home Path
    ${normalized}=    Normalize Path    ~/foo
    Should Be Equal    ${normalized}    ${home}${/}foo
    Directory Should Exist    ~

Tilde and username in path
    ${user}=    Get OS Independent Username
    ${home}=    Get OS Independent Home Path
    ${normalized}=    Normalize Path    ~${user}/foo
    Should Be Equal    ${normalized}    ${home}${/}foo
    Directory Should Exist    ~${user}

*** Keywords ***
Get OS Independent Username
    ${username}=    Get Environment Variable    USERNAME    NotSet
    ${user}=    Get Environment Variable    USER    ${username}
    [Return]    ${user}

Get OS Independent Home Path
    ${homepath}=    Get Environment Variable    HOMEPATH    NotSet
    ${homedrive}=    Get Environment Variable    HOMEDRIVE    NotSet
    ${home}=    Get Environment Variable    HOME    ${homedrive}${homepath}
    [Return]    ${home}
{'fraction_non_alphanumeric': 0.10939012584704744, 'fraction_numerical': 0.0, 'mean_word_length': 2.6844919786096257, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6648336', 'n_tokens_mistral': 589, 'n_tokens_neox': 563, 'n_words': 204}