From 0665f73cc7857f7cd5fed9a896999a7d8d75b3db Mon Sep 17 00:00:00 2001 From: Lars Eckart Date: Mon, 23 Oct 2023 20:25:56 +0300 Subject: [PATCH] ! r cache windows programs Co-Authored-By: Llewellyn Falco --- .../org/approvaltests/reporters/IntelliJResolverTest.java | 1 - .../src/main/java/org/approvaltests/reporters/DiffInfo.java | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/approvaltests-tests/src/test/java/org/approvaltests/reporters/IntelliJResolverTest.java b/approvaltests-tests/src/test/java/org/approvaltests/reporters/IntelliJResolverTest.java index abb3ae6a..7afb6427 100644 --- a/approvaltests-tests/src/test/java/org/approvaltests/reporters/IntelliJResolverTest.java +++ b/approvaltests-tests/src/test/java/org/approvaltests/reporters/IntelliJResolverTest.java @@ -35,7 +35,6 @@ void testFindItOnLinux() "/home/lars/.local/share/JetBrains/Toolbox/apps/intellij-idea-community-edition/bin/idea.sh"); verifyPaths(IntelliJToolboxResolver::getDiffInfoLinux, "/home/lars", validPaths); } - // "C:\Users\larse\AppData\Local\Programs\IntelliJ IDEA Ultimate\bin\idea64.exe" @Test void testFindItOnWindows() { diff --git a/approvaltests/src/main/java/org/approvaltests/reporters/DiffInfo.java b/approvaltests/src/main/java/org/approvaltests/reporters/DiffInfo.java index b02a9f81..44ce4dda 100644 --- a/approvaltests/src/main/java/org/approvaltests/reporters/DiffInfo.java +++ b/approvaltests/src/main/java/org/approvaltests/reporters/DiffInfo.java @@ -10,6 +10,7 @@ public class DiffInfo { + private static final String[] WINDOWS_PROGRAM_FILES = loadProgramFilesPaths(); public String diffProgram; public String parameters; public List fileExtensions; @@ -59,7 +60,10 @@ public boolean isEmpty() { return "".equals(diffProgram); } - public static String[] getProgramFilesPaths() + public static String[] getProgramFilesPaths(){ + return WINDOWS_PROGRAM_FILES; + } + public static String[] loadProgramFilesPaths() { List paths = new ArrayList<>(); addIfNotNull("ProgramFiles(x86)", paths);