Added to utils module in tests
Some checks failed
Rust Build / Check (pull_request) Successful in 25s
Rust Build / Test Suite (pull_request) Failing after 25s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 29s
Rust Build / build (pull_request) Successful in 28s
Some checks failed
Rust Build / Check (pull_request) Successful in 25s
Rust Build / Test Suite (pull_request) Failing after 25s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 29s
Rust Build / build (pull_request) Successful in 28s
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
mod utils {
|
mod utils {
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
use std::fs::File;
|
||||||
|
use std::io::{Read, Write};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
pub fn get_tests_directory() -> String {
|
pub fn get_tests_directory() -> String {
|
||||||
@@ -14,20 +16,8 @@ mod utils {
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
mod song_tests {
|
pub fn extract_data_from_file(filepath: &String) -> Result<Vec<u8>, std::io::Error> {
|
||||||
use std::fs::File;
|
|
||||||
use std::io::{Read, Write};
|
|
||||||
|
|
||||||
use tempfile::tempdir;
|
|
||||||
|
|
||||||
use icarus_models::song;
|
|
||||||
use icarus_models::types;
|
|
||||||
|
|
||||||
use crate::utils;
|
|
||||||
|
|
||||||
fn extract_data_from_file(filepath: &String) -> Result<Vec<u8>, std::io::Error> {
|
|
||||||
match std::fs::File::open(filepath) {
|
match std::fs::File::open(filepath) {
|
||||||
Ok(mut file) => {
|
Ok(mut file) => {
|
||||||
let mut buffer: Vec<u8> = Vec::new();
|
let mut buffer: Vec<u8> = Vec::new();
|
||||||
@@ -37,6 +27,18 @@ mod song_tests {
|
|||||||
Err(err) => Err(err),
|
Err(err) => Err(err),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod song_tests {
|
||||||
|
// use std::fs::File;
|
||||||
|
// use std::io::{Read, Write};
|
||||||
|
|
||||||
|
use tempfile::tempdir;
|
||||||
|
|
||||||
|
use icarus_models::song;
|
||||||
|
use icarus_models::types;
|
||||||
|
|
||||||
|
use crate::utils;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_song_to_data() {
|
fn test_song_to_data() {
|
||||||
|
Reference in New Issue
Block a user