mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 08:49:27 +08:00
Replace deprecated tempdir with tempfile
This also removes one dependency on the winapi crate. The current version of the time crate also depends on winapi, but work is being done to replace that version with 0.2 to remove the winapi dependency.
This commit is contained in:
parent
bb3db3f877
commit
c162a4516c
@ -72,7 +72,7 @@ memchr = "2.2.0"
|
|||||||
uuid = { version = "0.8", optional = true }
|
uuid = { version = "0.8", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempdir = "0.3"
|
tempfile = "3.1.0"
|
||||||
lazy_static = "1.0"
|
lazy_static = "1.0"
|
||||||
regex = "1.0"
|
regex = "1.0"
|
||||||
uuid = { version = "0.8", features = ["v4"] }
|
uuid = { version = "0.8", features = ["v4"] }
|
||||||
|
@ -79,13 +79,13 @@ mod test {
|
|||||||
use std::sync::mpsc::sync_channel;
|
use std::sync::mpsc::sync_channel;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tempdir::TempDir;
|
use tempfile;
|
||||||
|
|
||||||
use crate::{Connection, Error, ErrorCode, Result, TransactionBehavior, NO_PARAMS};
|
use crate::{Connection, Error, ErrorCode, Result, TransactionBehavior, NO_PARAMS};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_default_busy() {
|
fn test_default_busy() {
|
||||||
let temp_dir = TempDir::new("test_default_busy").unwrap();
|
let temp_dir = tempfile::tempdir().unwrap();
|
||||||
let path = temp_dir.path().join("test.db3");
|
let path = temp_dir.path().join("test.db3");
|
||||||
|
|
||||||
let mut db1 = Connection::open(&path).unwrap();
|
let mut db1 = Connection::open(&path).unwrap();
|
||||||
@ -106,7 +106,7 @@ mod test {
|
|||||||
#[test]
|
#[test]
|
||||||
#[ignore] // FIXME: unstable
|
#[ignore] // FIXME: unstable
|
||||||
fn test_busy_timeout() {
|
fn test_busy_timeout() {
|
||||||
let temp_dir = TempDir::new("test_busy_timeout").unwrap();
|
let temp_dir = tempfile::tempdir().unwrap();
|
||||||
let path = temp_dir.path().join("test.db3");
|
let path = temp_dir.path().join("test.db3");
|
||||||
|
|
||||||
let db2 = Connection::open(&path).unwrap();
|
let db2 = Connection::open(&path).unwrap();
|
||||||
@ -145,7 +145,7 @@ mod test {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
let temp_dir = TempDir::new("test_busy_handler").unwrap();
|
let temp_dir = tempfile::tempdir().unwrap();
|
||||||
let path = temp_dir.path().join("test.db3");
|
let path = temp_dir.path().join("test.db3");
|
||||||
|
|
||||||
let db2 = Connection::open(&path).unwrap();
|
let db2 = Connection::open(&path).unwrap();
|
||||||
|
@ -869,7 +869,7 @@ mod test {
|
|||||||
use fallible_iterator::FallibleIterator;
|
use fallible_iterator::FallibleIterator;
|
||||||
use std::error::Error as StdError;
|
use std::error::Error as StdError;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use tempdir::TempDir;
|
use tempfile;
|
||||||
|
|
||||||
// this function is never called, but is still type checked; in
|
// this function is never called, but is still type checked; in
|
||||||
// particular, calls with specific instantiations will require
|
// particular, calls with specific instantiations will require
|
||||||
@ -892,7 +892,7 @@ mod test {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_concurrent_transactions_busy_commit() {
|
fn test_concurrent_transactions_busy_commit() {
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
let tmp = TempDir::new("locked").unwrap();
|
let tmp = tempfile::tempdir().unwrap();
|
||||||
let path = tmp.path().join("transactions.db3");
|
let path = tmp.path().join("transactions.db3");
|
||||||
|
|
||||||
Connection::open(&path)
|
Connection::open(&path)
|
||||||
@ -938,7 +938,7 @@ mod test {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_persistence() {
|
fn test_persistence() {
|
||||||
let temp_dir = TempDir::new("test_open_file").unwrap();
|
let temp_dir = tempfile::tempdir().unwrap();
|
||||||
let path = temp_dir.path().join("test.db3");
|
let path = temp_dir.path().join("test.db3");
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user