IJent tests: first integration test for stat

GitOrigin-RevId: 2e4dc5a69eb61cfd4e55d169774efcde1127ecf5
This commit is contained in:
Vladimir Lagunov
2024-02-09 15:25:29 +01:00
committed by intellij-monorepo-bot
parent afc4e997b8
commit 64681e17c1
2 changed files with 10 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ interface IjentExecFileProvider {
suspend fun getInstance(): IjentExecFileProvider = serviceAsync()
}
enum class SupportedPlatform(private val os: OS, private val arch: Arch) {
enum class SupportedPlatform(val os: OS, val arch: Arch) {
AARCH64__DARWIN(OS.DARWIN, Arch.AARCH64),
AARCH64__LINUX(OS.LINUX, Arch.AARCH64),
X86_64__DARWIN(OS.DARWIN, Arch.X86_64),

View File

@@ -1,6 +1,9 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.platform.ijent.fs
import com.intellij.platform.ijent.IjentExecFileProvider
import com.intellij.platform.ijent.IjentExecFileProvider.SupportedPlatform.OS.*
import com.intellij.platform.ijent.fs.IjentPath.Absolute.OS
import org.jetbrains.annotations.ApiStatus
import java.nio.file.InvalidPathException
@@ -229,4 +232,10 @@ fun <P : IjentPath> IjentPathResult<P>.getOrThrow(): P =
when (this) {
is IjentPathResult.Ok -> path
is IjentPathResult.Err -> throw InvalidPathException(raw, reason)
}
val IjentExecFileProvider.SupportedPlatform.OS.pathOs: OS
get() = when (this) {
DARWIN, LINUX -> OS.UNIX
WINDOWS -> OS.WINDOWS
}