From b792ccbb5431b9d37f0bb7d5d751c681968320b0 Mon Sep 17 00:00:00 2001 From: James Ide Date: Sat, 28 Nov 2026 02:44:51 -0800 Subject: [PATCH] Compare canonical paths in PreparePrefabHeadersTaskTest `preparePrefabHeadersTask_declaresTheHeadersItCopiesAsInputs` compares the task's input files with a file under JUnit's temporary folder. On macOS that folder is under `/var`, a symbolic link to `/private/var`, and Gradle reports the inputs by canonical path, so the test fails: Expecting actual: [/private/var/folders/.../input/hello.h] to contain exactly (and in same order): [/var/folders/.../input/hello.h] Compare canonical files on both sides. Co-Authored-By: Claude Opus 5.5 --- .../react/tasks/internal/PreparePrefabHeadersTaskTest.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PreparePrefabHeadersTaskTest.kt b/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PreparePrefabHeadersTaskTest.kt index 4b1e714e710b..49b303e57ffb 100644 --- a/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PreparePrefabHeadersTaskTest.kt +++ b/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PreparePrefabHeadersTaskTest.kt @@ -216,7 +216,10 @@ class PreparePrefabHeadersTaskTest { it.input.set(listOf(PrefabPreprocessingEntry("sample_library", "input/" to ""))) } - assertThat(task.inputs.files.files).containsExactly(header) + // Gradle reports the files by canonical path, and on macOS the temporary folder is behind a + // symbolic link (/var). + assertThat(task.inputs.files.files.map { it.canonicalFile }) + .containsExactly(header.canonicalFile) } @Test