From 2eaeb83ec3eb97a1afa5f1b40d9d8d76e3e37958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ga=C3=9F?= Date: Mon, 23 Jul 2018 17:00:41 +0200 Subject: [PATCH] Fix wrong path in diff tests on macOS --- pkg/commands/diff_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/commands/diff_test.go b/pkg/commands/diff_test.go index c5ab00567..42147e375 100644 --- a/pkg/commands/diff_test.go +++ b/pkg/commands/diff_test.go @@ -44,8 +44,9 @@ func TestDiff(t *testing.T) { const updateEnvVar = "UPDATE_KUSTOMIZE_EXPECTED_DATA" updateKustomizeExpected := os.Getenv(updateEnvVar) == "true" - noopDir, _ := regexp.Compile(`/tmp/noop-[0-9]*/`) - transformedDir, _ := regexp.Compile(`/tmp/transformed-[0-9]*/`) + tempDir := regexp.QuoteMeta(filepath.Clean(os.TempDir())) + noopDir, _ := regexp.Compile(tempDir + `/noop-[0-9]*/`) + transformedDir, _ := regexp.Compile(tempDir + `/transformed-[0-9]*/`) timestamp, _ := regexp.Compile(`[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9].[0-9]* [+-]{1}[0-9]{4}`) fs := fs.MakeRealFS()