From 1b75603f63eb87a78be4e423139d24c151741030 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 25 Oct 2023 18:30:06 +0200 Subject: [PATCH] Implement `os_name`, `os_version` and `app_version` for `TestPlatform` Co-Authored-By: Conrad Irwin Co-Authored-By: Kyle --- crates/gpui2/src/platform/test/platform.rs | 26 +++++++++------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/crates/gpui2/src/platform/test/platform.rs b/crates/gpui2/src/platform/test/platform.rs index 01c56090f7..9cc7d959e0 100644 --- a/crates/gpui2/src/platform/test/platform.rs +++ b/crates/gpui2/src/platform/test/platform.rs @@ -1,4 +1,5 @@ use crate::{DisplayId, Executor, Platform, PlatformTextSystem}; +use anyhow::{anyhow, Result}; use std::sync::Arc; pub struct TestPlatform { @@ -132,18 +133,18 @@ impl Platform for TestPlatform { } fn os_name(&self) -> &'static str { - unimplemented!() + "test" } - fn os_version(&self) -> anyhow::Result { - unimplemented!() + fn os_version(&self) -> Result { + Err(anyhow!("os_version called on TestPlatform")) } - fn app_version(&self) -> anyhow::Result { - unimplemented!() + fn app_version(&self) -> Result { + Err(anyhow!("app_version called on TestPlatform")) } - fn app_path(&self) -> anyhow::Result { + fn app_path(&self) -> Result { unimplemented!() } @@ -151,7 +152,7 @@ impl Platform for TestPlatform { unimplemented!() } - fn path_for_auxiliary_executable(&self, _name: &str) -> anyhow::Result { + fn path_for_auxiliary_executable(&self, _name: &str) -> Result { unimplemented!() } @@ -171,20 +172,15 @@ impl Platform for TestPlatform { unimplemented!() } - fn write_credentials( - &self, - _url: &str, - _username: &str, - _password: &[u8], - ) -> anyhow::Result<()> { + fn write_credentials(&self, _url: &str, _username: &str, _password: &[u8]) -> Result<()> { unimplemented!() } - fn read_credentials(&self, _url: &str) -> anyhow::Result)>> { + fn read_credentials(&self, _url: &str) -> Result)>> { unimplemented!() } - fn delete_credentials(&self, _url: &str) -> anyhow::Result<()> { + fn delete_credentials(&self, _url: &str) -> Result<()> { unimplemented!() } }