From 0b55470e40ab7435f445813ebc18b1107ecf7e32 Mon Sep 17 00:00:00 2001
From: Rob Herley <robherley@github.com>
Date: Mon, 18 Dec 2023 12:43:05 -0500
Subject: [PATCH] add test case for globbed downloads to same directory

---
 .github/workflows/test.yml | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 3209828..d23bbb7 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -106,3 +106,25 @@ jobs:
             Write-Error "File contents of downloaded artifacts are incorrect"
         }
       shell: pwsh
+
+    # Test glob downloading both artifacts to same directory
+    - name: Download all Artifacts
+      uses: ./
+      with:
+        pattern: Artifact-*
+        path: single/directory
+        merge-multiple: true
+
+    - name: Verify successful download
+      run: |
+        $fileA = "single/directory/file-A.txt"
+        $fileB = "single/directory/file-B.txt"
+        if(!(Test-Path -path $fileA) -or !(Test-Path -path $fileB))
+        {
+            Write-Error "Expected files do not exist"
+        }
+        if(!((Get-Content $fileA) -ceq "Lorem ipsum dolor sit amet") -or !((Get-Content $fileB) -ceq "Hello world from file B"))
+        {
+            Write-Error "File contents of downloaded artifacts are incorrect"
+        }
+      shell: pwsh