mirror of
https://github.com/async-rs/async-std.git
synced 2025-04-26 10:16:49 +00:00
Merge pull request #859 from Keruspe/tempfile
switch from tempdir to tempfile
This commit is contained in:
commit
26f6198065
2 changed files with 9 additions and 5 deletions
|
@ -102,7 +102,7 @@ optional = true
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
femme = "2.1.1"
|
femme = "2.1.1"
|
||||||
rand = "0.7.3"
|
rand = "0.7.3"
|
||||||
tempdir = "0.3.7"
|
tempfile = "3.1.0"
|
||||||
futures = "0.3.4"
|
futures = "0.3.4"
|
||||||
rand_xorshift = "0.2.0"
|
rand_xorshift = "0.2.0"
|
||||||
|
|
||||||
|
|
12
tests/uds.rs
12
tests/uds.rs
|
@ -5,8 +5,6 @@ use async_std::os::unix::net::{UnixDatagram, UnixListener, UnixStream};
|
||||||
use async_std::prelude::*;
|
use async_std::prelude::*;
|
||||||
use async_std::task;
|
use async_std::task;
|
||||||
|
|
||||||
use tempdir::TempDir;
|
|
||||||
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
const JULIUS_CAESAR: &[u8] = b"
|
const JULIUS_CAESAR: &[u8] = b"
|
||||||
|
@ -51,7 +49,10 @@ const TEST_TIMEOUT: Duration = Duration::from_secs(3);
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn socket_ping_pong() {
|
fn socket_ping_pong() {
|
||||||
let tmp_dir = TempDir::new("socket_ping_pong").expect("Temp dir not created");
|
let tmp_dir = tempfile::Builder::new()
|
||||||
|
.prefix("socket_ping_pong")
|
||||||
|
.tempdir()
|
||||||
|
.expect("Temp dir not created");
|
||||||
let sock_path = tmp_dir.as_ref().join("sock");
|
let sock_path = tmp_dir.as_ref().join("sock");
|
||||||
let iter_cnt = 16;
|
let iter_cnt = 16;
|
||||||
|
|
||||||
|
@ -98,7 +99,10 @@ async fn ping_pong_client(socket: &std::path::PathBuf, iterations: u32) -> std::
|
||||||
#[test]
|
#[test]
|
||||||
fn uds_clone() -> io::Result<()> {
|
fn uds_clone() -> io::Result<()> {
|
||||||
task::block_on(async {
|
task::block_on(async {
|
||||||
let tmp_dir = TempDir::new("socket_ping_pong").expect("Temp dir not created");
|
let tmp_dir = tempfile::Builder::new()
|
||||||
|
.prefix("socket_ping_pong")
|
||||||
|
.tempdir()
|
||||||
|
.expect("Temp dir not created");
|
||||||
let sock_path = tmp_dir.as_ref().join("sock");
|
let sock_path = tmp_dir.as_ref().join("sock");
|
||||||
let input = UnixListener::bind(&sock_path).await?;
|
let input = UnixListener::bind(&sock_path).await?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue