Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/test/java/com/github/copilot/sdk/TestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,27 @@
import java.nio.file.Paths;

/**
* Shared test utilities for locating the Copilot CLI binary.
* Shared test utilities for locating the Copilot CLI binary and other
* cross-platform test helpers.
*/
final class TestUtil {
public final class TestUtil {

private TestUtil() {
}

/**
* Returns a platform-independent path string for a file inside the system
* temporary directory. Uses {@code java.io.tmpdir} so tests run correctly on
* both POSIX and Windows.
*
* @param filename
* the file name (no directory separator required)
* @return absolute path string in the system temp directory
*/
public static String tempPath(String filename) {
return Path.of(System.getProperty("java.io.tmpdir"), filename).toString();
}

/**
* Locates a launchable Copilot CLI executable.
* <p>
Expand Down
Loading
Loading