only linux

This commit is contained in:
nora 2023-01-22 12:13:51 +01:00
parent b993b564a2
commit 22804c3065

View file

@ -48,12 +48,12 @@ fn wrap_func_body(func: &str) -> Result<String> {
} }
impl RustFunction { impl RustFunction {
#[cfg(not(unix))] #[cfg(not(target_os = "linux"))]
pub fn compile(body: &str) -> Result<Self> { pub fn compile(body: &str) -> Result<Self> {
Err(anyhow::anyhow!("--verify-fn only works on unix")) Err(anyhow::anyhow!("--verify-fn only works on unix"))
} }
#[cfg(unix)] #[cfg(target_os = "linux")]
pub fn compile(body: &str) -> Result<Self> { pub fn compile(body: &str) -> Result<Self> {
use anyhow::bail; use anyhow::bail;
use std::io; use std::io;
@ -123,7 +123,7 @@ mod tests {
use super::RustFunction; use super::RustFunction;
#[test] #[test]
#[cfg_attr(not(unix), ignore)] #[cfg_attr(not(target_os = "linux"), ignore)]
fn basic_contains_work() { fn basic_contains_work() {
let code = r#"|output| output.contains("test")"#; let code = r#"|output| output.contains("test")"#;