22
33// Only compile this for Unix-like platforms (Linux, macOS) because they have an oracle to compare
44// against.
5- #![ cfg( unix) ]
5+ #![ cfg( any ( unix, windows ) ) ]
66
77use anyhow:: { Context , Result } ;
88use assert_fs:: fixture:: { FileWriteStr , PathChild } ;
@@ -11,6 +11,7 @@ use colored::Colorize;
1111use descape:: UnescapeExt ;
1212use serde:: { Deserialize , Serialize } ;
1313use std:: fs;
14+ #[ cfg( unix) ]
1415use std:: os:: unix:: { fs:: PermissionsExt , process:: ExitStatusExt } ;
1516use std:: {
1617 collections:: { HashMap , HashSet } ,
@@ -932,6 +933,7 @@ impl TestCase {
932933 test_file_path. write_str ( test_file. contents . as_str ( ) ) ?;
933934 }
934935
936+ #[ cfg( unix) ]
935937 if test_file. executable {
936938 // chmod u+x
937939 let mut perms = test_file_path. metadata ( ) ?. permissions ( ) ;
@@ -1094,6 +1096,13 @@ impl TestCase {
10941096 }
10951097
10961098 #[ expect( clippy:: unused_async) ]
1099+ #[ cfg( not( unix) ) ]
1100+ async fn run_command_with_pty ( & self , _cmd : std:: process:: Command ) -> Result < RunResult > {
1101+ Err ( anyhow:: anyhow!( "pty test not supported on this platform" ) )
1102+ }
1103+
1104+ #[ expect( clippy:: unused_async) ]
1105+ #[ cfg( unix) ]
10971106 async fn run_command_with_pty ( & self , cmd : std:: process:: Command ) -> Result < RunResult > {
10981107 use expectrl:: Expect ;
10991108
@@ -1553,6 +1562,7 @@ impl TestOptions {
15531562 }
15541563}
15551564
1565+ #[ cfg( unix) ]
15561566fn read_expectrl_log ( log : Vec < u8 > ) -> Result < String > {
15571567 let output_str = String :: from_utf8 ( log) ?;
15581568 let output: String = output_str
0 commit comments