fix: csv_parser tests
This commit is contained in:
@ -79,14 +79,14 @@ fn parse_csv_field(field: &str) -> Value {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::fs;
|
use std::{fs, path::PathBuf};
|
||||||
use tempfile::tempdir;
|
use tempfile::tempdir;
|
||||||
|
|
||||||
fn create_temp_csv(content: &str) -> (String, tempfile::TempDir) {
|
fn create_temp_csv(content: &str) -> (PathBuf, tempfile::TempDir) {
|
||||||
let dir = tempdir().unwrap();
|
let dir = tempdir().unwrap();
|
||||||
let path = dir.path().join("test.csv");
|
let path = dir.path().join("test.csv");
|
||||||
fs::write(&path, content).unwrap();
|
fs::write(&path, content).unwrap();
|
||||||
(path.to_string_lossy().to_string(), dir)
|
(path, dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user