<commit_before>﻿##
## Copyright (c) Microsoft Corporation, 2015
##

Describe "Tests Get-Command with relative paths and wildcards" -Tag "CI" {

    BeforeAll {
        # Create temporary EXE command files
        $file1 = Setup -f WildCardCommandA.exe -pass
        $file2 = Setup -f WildCard
        $null = New-Item -ItemType File -Path (Join-Path $TestDrive WildCardCommandA.exe) -ErrorAction Ignore
        $null = New-Item -ItemType File -Path (Join-Path $TestDRive WildCardCommand[B].exe) -ErrorAction Ignore
        if ( $IsLinux -or $IsOSX ) {
            /bin/chmod +x
        }
    }

    It "Test wildcard with drive relative directory path" {
        $pathName = Join-Path $TestDrive "WildCardCommandA*"
        $pathName = $pathName.Substring(2, ($pathName.Length - 2))
        $result = Get-Command -Name $pathName
        $result | Should Not Be $null
        $result.Name | Should Be WildCardCommandA.exe
    }<commit_msg>Fix Get-Command tests to better handle non-Windows platforms.<commit_after>﻿##
## Copyright (c) Microsoft Corporation, 2015
##

Describe "Tests Get-Command with relative paths and wildcards" -Tag "CI" {

    BeforeAll {
        # Create temporary EXE command files
        $file1 = Setup -f WildCardCommandA.exe -pass
        $file2 = Setup -f WildCardCommand[B].exe -pass
        #$null = New-Item -ItemType File -Path (Join-Path $TestDrive WildCardCommandA.exe) -ErrorAction Ignore
        #$null = New-Item -ItemType File -Path (Join-Path $TestDRive WildCardCommand[B].exe) -ErrorAction Ignore
        if ( $IsLinux -or $IsOSX ) {
            /bin/chmod 777 "$file1"
            /bin/chmod 777 "$file2"
        }
    }

    It "Test wildcard with drive relative directory path" {
        $pathName = Join-Path $TestDrive "WildCardCommandA*"
        $driveOffset = $pathName.IndexOf(":")
        $pathName = $pathName.Substring($driveOffset + 1)
        $result = Get-Command -Name $pathName
        $result | Should Not Be $null
        $result.Name | Should Be WildCardCommandA.exe
    }
{'fraction_non_alphanumeric': 0.10892065056678167, 'fraction_numerical': 0.011335633316904879, 'mean_word_length': 2.580246913580247, 'pattern_counts': {'":': 1, '<': 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': '3877989', 'n_tokens_mistral': 641, 'n_tokens_neox': 604, 'n_words': 185}