mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 18:13:42 +08:00 
			
		
		
		
	bake: windows entitlement path fixes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
		@@ -4,6 +4,7 @@ import (
 | 
				
			|||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"path/filepath"
 | 
						"path/filepath"
 | 
				
			||||||
 | 
						"runtime"
 | 
				
			||||||
	"slices"
 | 
						"slices"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -82,7 +83,13 @@ func TestEvaluateToExistingPath(t *testing.T) {
 | 
				
			|||||||
		{
 | 
							{
 | 
				
			||||||
			name:  "Root path",
 | 
								name:  "Root path",
 | 
				
			||||||
			input: "/",
 | 
								input: "/",
 | 
				
			||||||
			expected:  "/",
 | 
								expected: func() string {
 | 
				
			||||||
 | 
									root := "/"
 | 
				
			||||||
 | 
									if runtime.GOOS == "windows" {
 | 
				
			||||||
 | 
										root = filepath.VolumeName(root)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									return root
 | 
				
			||||||
 | 
								}(),
 | 
				
			||||||
			expectErr: false,
 | 
								expectErr: false,
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -163,7 +170,7 @@ func TestDedupePaths(t *testing.T) {
 | 
				
			|||||||
			arr = toRelativePaths(arr, wd)
 | 
								arr = toRelativePaths(arr, wd)
 | 
				
			||||||
			m := make(map[string]struct{})
 | 
								m := make(map[string]struct{})
 | 
				
			||||||
			for _, v := range arr {
 | 
								for _, v := range arr {
 | 
				
			||||||
				m[v] = struct{}{}
 | 
									m[filepath.ToSlash(v)] = struct{}{}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			require.Equal(t, tc.out, m)
 | 
								require.Equal(t, tc.out, m)
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user