Skip to content

Commit

Permalink
fix: tests when running on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
john-cd committed May 16, 2024
1 parent 3ff2d2a commit b60e937
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 15 deletions.
2 changes: 2 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# TODO

- fix leaky tests when using nextest on Windows

- review each .md file in turn

[Introduction](src/index.md) polish the intro
Expand Down
3 changes: 3 additions & 0 deletions deps/tests/associated_types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code)]

trait Iterator {
type Item; // <-- associated type
// in Impl, use e.g. `Iterator<Item = u32>`
Expand All @@ -12,5 +14,6 @@ trait Add<Rhs = Self> {
fn add(self, rhs: Rhs) -> Self::Output;
}

// TODO
#[test]
fn test() {}
3 changes: 3 additions & 0 deletions deps/tests/async_traits2.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// TODO
#![allow(dead_code)]

trait Container {
fn items(&self) -> impl Iterator<Item = u8>; // <-- return Impl in a trait
}
Expand Down
11 changes: 6 additions & 5 deletions deps/tests/error-file.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use std::fs::File;
use std::io::Error;
use std::process::Command;
use std::process::Stdio;

#[test]
#[cfg(target_family = "unix")]
fn test() -> Result<(), Error> {
use std::fs::File;
use std::io::Error;
use std::process::Command;
use std::process::Stdio;

let outputs = File::create("out.txt")?;
let errors = outputs.try_clone()?;

Expand Down
2 changes: 2 additions & 0 deletions deps/tests/macros.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![allow(clippy::useless_vec)]
#![allow(dead_code)]
// TODO ^

#[test]
fn test() {
Expand Down
10 changes: 5 additions & 5 deletions deps/tests/piped.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::process::Command;
use std::process::Stdio;

use anyhow::Result;

#[test]
#[cfg(target_family = "unix")]
fn test() -> Result<()> {
use std::process::Command;
use std::process::Stdio;
use anyhow::Result;

let directory = std::env::current_dir()?;
let mut du_output_child = Command::new("du")
.arg("-ah")
Expand Down
11 changes: 6 additions & 5 deletions deps/tests/tar-compress.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use std::fs::File;

use flate2::write::GzEncoder;
use flate2::Compression;

#[test]
#[cfg(target_family = "unix")]
fn test() -> Result<(), std::io::Error> {
use std::fs::File;

use flate2::write::GzEncoder;
use flate2::Compression;

let tar_gz = File::create("archive.tar.gz")?;
let enc = GzEncoder::new(tar_gz, Compression::default());
let mut tar = tar::Builder::new(enc);
Expand Down
3 changes: 3 additions & 0 deletions deps/tests/traits2.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// TODO
#![allow(dead_code)]

trait Summary {
fn summarize_author(&self) -> String;

Expand Down

0 comments on commit b60e937

Please sign in to comment.