From 5d50f446a1a4612c0c931bdbc61f945760392f29 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Fri, 4 Nov 2022 23:41:21 +0100 Subject: "finished" update, added some tests --- .gitignore | 2 +- Cargo.lock | 201 ++++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 6 +- config.ini | 1 + data.db | Bin 36864 -> 36864 bytes src/apis/modrinth.rs | 23 +++++ src/commands/modification.rs | 11 +-- src/commands/update.rs | 140 +++++++++++++++++++++++++----- src/config.rs | 1 + src/db.rs | 32 ++++++- src/input.rs | 10 ++- tests/db/mod.rs | 4 +- tests/db_integration.rs | 1 - 13 files changed, 387 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index ec088fc..c91ef38 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /target /api-tests -/data +/dl .planmodlist.autosave.xopp diff --git a/Cargo.lock b/Cargo.lock index 4f1f0d6..29e309e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,6 +13,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "async-trait" version = "0.1.58" @@ -75,6 +84,31 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "time", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "config" version = "0.13.2" @@ -129,6 +163,50 @@ dependencies = [ "typenum", ] +[[package]] +name = "cxx" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "digest" version = "0.10.5" @@ -208,6 +286,17 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +[[package]] +name = "futures-macro" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "futures-sink" version = "0.3.25" @@ -227,9 +316,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-core", + "futures-macro", "futures-task", "pin-project-lite", "pin-utils", + "slab", ] [[package]] @@ -250,7 +341,7 @@ checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -361,6 +452,30 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "idna" version = "0.3.0" @@ -434,6 +549,15 @@ version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -485,7 +609,7 @@ checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.42.0", ] @@ -493,7 +617,9 @@ dependencies = [ name = "modlist" version = "0.1.0" dependencies = [ + "chrono", "config", + "futures-util", "reqwest", "serde", "serde_json", @@ -529,6 +655,25 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + [[package]] name = "num_cpus" version = "1.13.1" @@ -762,6 +907,7 @@ dependencies = [ "serde_urlencoded", "tokio", "tokio-native-tls", + "tokio-util", "tower-service", "url", "wasm-bindgen", @@ -813,6 +959,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + [[package]] name = "security-framework" version = "2.7.0" @@ -926,9 +1078,9 @@ dependencies = [ [[package]] name = "sqlite" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e66cb949f931ece6201d72bffad3f3601b94998a345793713dd13af70a77c185" +checksum = "125b4c6f5428ee2fc895b6c3633f7761084028481bca9a02dce6477d80eff083" dependencies = [ "libc", "sqlite3-sys", @@ -979,6 +1131,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" version = "1.0.37" @@ -999,6 +1160,17 @@ dependencies = [ "syn", ] +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -1143,6 +1315,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + [[package]] name = "url" version = "2.3.1" @@ -1176,6 +1354,12 @@ dependencies = [ "try-lock", ] +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1274,6 +1458,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index bbc0456..d5c39d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,9 +6,11 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -reqwest = { version = "0.11", features = ["json"] } +reqwest = { version = "0.11", features = ["json", "stream"] } tokio = { version = "1", features = ["full"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.87" config = "0.13.2" -sqlite = "0.27.3" +sqlite = "0.28.0" +futures-util = "0.3.14" +chrono = "0.4.22" diff --git a/config.ini b/config.ini index 0ffe0ac..345a13a 100644 --- a/config.ini +++ b/config.ini @@ -1,5 +1,6 @@ data = "./" clean_remove = false +downloads = "./dl" [apis] modrinth = "http://localhost:8080/" diff --git a/data.db b/data.db index 73464d8..2d258dc 100644 Binary files a/data.db and b/data.db differ diff --git a/src/apis/modrinth.rs b/src/apis/modrinth.rs index 0c3eca5..c71b47f 100644 --- a/src/apis/modrinth.rs +++ b/src/apis/modrinth.rs @@ -1,3 +1,5 @@ +use std::io::{Error, ErrorKind}; +use chrono::{DateTime, FixedOffset}; use serde::Deserialize; use crate::{Modloader, List}; @@ -153,3 +155,24 @@ pub async fn versions(api: String, id: String, list: List) -> Vec { serde_json::from_slice(&data.await.unwrap()).unwrap() } + +pub fn extract_current_version(versions: Vec) -> Result> { + match versions.len() { + 0 => Err(Box::new(Error::new(ErrorKind::NotFound, "NO_VERSIONS_AVAILABLE"))), + //TODO compare publish dates + 1.. => { + let mut times: Vec<(String, DateTime)> = vec![]; + for ver in versions { + let stamp = DateTime::parse_from_rfc3339(&ver.date_published)?; + times.push((ver.id, stamp)) + } + dbg!(×); + times.sort_by_key(|t| t.1); + times.reverse(); + dbg!(×); + println!("CW: {}", times[0].0); + Ok(times[0].0.to_string()) + }, + _ => panic!("available_versions should never be negative"), + } +} diff --git a/src/commands/modification.rs b/src/commands/modification.rs index 43e2180..b90c82c 100644 --- a/src/commands/modification.rs +++ b/src/commands/modification.rs @@ -1,6 +1,6 @@ use std::io::{Error, ErrorKind}; -use crate::{modrinth::{project, versions, Version}, config::Cfg, db::{insert_mod, remove_mod_from_list, get_mod_id, insert_mod_in_list, get_mods, get_mods_from_list}, input::Input, get_current_list}; +use crate::{modrinth::{project, versions, extract_current_version}, config::Cfg, db::{insert_mod, remove_mod_from_list, get_mod_id, insert_mod_in_list, get_mods, get_mods_from_list}, input::Input, get_current_list}; pub async fn modification(config: Cfg, args: Option>) -> Result<(), Box> { @@ -77,12 +77,3 @@ fn remove(config: Cfg, args: Vec) -> Result<(), Box Ok(()), } } - -fn extract_current_version(versions: Vec) -> Result> { - match versions.len() { - 0 => Err(Box::new(Error::new(ErrorKind::NotFound, "NO_VERSIONS_AVAILABLE"))), - //TODO compare publish dates - 1.. => Ok(versions[0].id.to_string()), - _ => panic!("available_versions should never be negative"), - } -} diff --git a/src/commands/update.rs b/src/commands/update.rs index 14c37ec..6275bce 100644 --- a/src/commands/update.rs +++ b/src/commands/update.rs @@ -1,40 +1,138 @@ -use std::io::{Error, ErrorKind}; +use std::{io::{Error, ErrorKind, Write}, fs::File}; -use crate::{config::Cfg, modrinth::projects, get_current_list, db::{get_mods_from_list, get_versions}}; +use reqwest::Client; + +use futures_util::StreamExt; + +use crate::{config::Cfg, modrinth::{projects, Project, versions, extract_current_version, Version}, get_current_list, db::{get_mods_from_list, get_versions, get_list_version, change_list_versions}, List}; pub async fn update(config: Cfg) -> Result<(), Box> { let current_list = get_current_list(config.clone())?; - let mods = get_mods_from_list(config.clone(), current_list)?; + let mods = get_mods_from_list(config.clone(), current_list.clone())?; + + let mut versions = get_versions(config.clone(), mods.clone())?; + versions.sort_by_key(|ver| ver.mod_id.clone()); - let mut projects = projects(String::from(&config.apis.modrinth), mods.clone()).await; + let mut projects = projects(String::from(&config.apis.modrinth), mods).await; + projects.sort_by_key(|pro| pro.id.clone()); - let mut versions = get_versions(config, mods)?; + let mut updatestack: Vec = vec![]; + for (index, project) in projects.into_iter().enumerate() { + let current_version = &versions[index]; + + let p_id = String::from(&project.id); + let v_id = ¤t_version.mod_id; + + if &p_id != v_id { return Err(Box::new(Error::new(ErrorKind::Other, "SORTING_ERROR"))) }; + + if project.versions.join("|") != current_version.versions { + updatestack.push(match specific_update(config.clone(), current_list.clone(), project).await { + Ok(ver) => ver, + //TODO handle errors (only continue on "NO_UPDATE_AVAILABLE") + Err(_) => { continue; }, + }); + }; + }; + //println!("{:?}", updatestack); + + //download_updates(config, updatestack).await?; + + Ok(()) +} + +async fn specific_update(config: Cfg, list: List, project: Project) -> Result> { + print!("Checking update for '{}' in {}", project.title, list.id); - projects.sort_by_key(|p| p.id.clone()); + let applicable_versions = versions(String::from(&config.apis.modrinth), String::from(&project.id), list.clone()).await; + + let mut versions: Vec = vec![]; - versions.sort_by_key(|v| v.mod_id.clone()); + for ver in &applicable_versions { + versions.push(String::from(&ver.id)); + } - let mut update_stack: Vec = vec![]; + let mut current: Vec = vec![]; + if versions.join("|") != get_list_version(config.clone(), list.clone(), String::from(&project.id))? { + //get new versions + print!(" | getting new version"); + let current_str = extract_current_version(applicable_versions.clone())?; + current.push(applicable_versions.into_iter().find(|ver| ver.id == current_str).unwrap()); + change_list_versions(config, list, current_str, versions, project.id)?; + } - for (index, project) in projects.iter().enumerate() { + if current.is_empty() { return Err(Box::new(Error::new(ErrorKind::NotFound, "NO_UPDATE_AVAILABLE"))) }; + + println!(" | ✔️"); + Ok(current[0].clone()) +} - let cmp_version = &versions[index]; +async fn download_updates(config: Cfg, versions: Vec) -> Result> { - let p_id = &project.id; - let v_id = &cmp_version.mod_id; + let dl_path = String::from(&config.downloads); - if p_id != v_id { return Err(Box::new(Error::new(ErrorKind::Other, "COMPARE_SORTING_ERR"))); }; - println!("{}:{}", p_id, v_id); + for ver in versions { + let primary_file = ver.files.into_iter().find(|file| file.primary).unwrap(); + let dl_path_file = format!("{}/{}", config.downloads, primary_file.filename); + println!("Downloading {}", primary_file.url); - if project.versions.join("|") != cmp_version.versions { - update_stack.push(String::from(&project.id)); - }; - }; + let res = Client::new() + .get(String::from(&primary_file.url)) + .send() + .await + .or(Err(format!("Failed to GET from '{}'", &primary_file.url)))?; + + // download chunks + let mut file = File::create(String::from(&dl_path_file)).or(Err(format!("Failed to create file '{}'", dl_path_file)))?; + let mut stream = res.bytes_stream(); - //TODO UPDATE - dbg!(update_stack); + while let Some(item) = stream.next().await { + let chunk = item.or(Err("Error while downloading file"))?; + file.write_all(&chunk) + .or(Err("Error while writing to file"))?; + } + } - Ok(()) + Ok(dl_path) +} + +#[tokio::test] +async fn download_updates_test() { + + use crate::{modrinth::{Version, VersionFile, Hash, VersionType}, config::{Cfg, Apis}}; + + let config = Cfg { data: "...".to_string(), clean_remove: false, downloads: "./dl".to_string(), apis: Apis { modrinth: "...".to_string() } }; + + let versions = vec![Version { + id: "dEqtGnT9".to_string(), + project_id: "kYuIpRLv".to_string(), + author_id: "Qnt13hO8".to_string(), + featured: true, + name: "1.2.2-1.19 - Fabric".to_string(), + version_number: "1.2.2-1.19".to_string(), + changelog: None, + date_published: "2022-11-02T17:41:43.072267Z".to_string(), + downloads: 58, + version_type: VersionType::release, + files: vec![VersionFile { + hashes: Hash { + sha1: "fdc6dc39427fc92cc1d7ad8b275b5b83325e712b".to_string(), + sha512: "5b372f00d6e5d6a5ef225c3897826b9f6a2be5506905f7f71b9e939779765b41be6f2a9b029cfc752ad0751d0d2d5f8bb4544408df1363eebdde15641e99a849".to_string() + }, + url: "https://cdn.modrinth.com/data/kYuIpRLv/versions/dEqtGnT9/waveycapes-fabric-1.2.2-mc1.19.2.jar".to_string(), + filename: "waveycapes-fabric-1.2.2-mc1.19.2.jar".to_string(), + primary: true, + size: 323176 + }], + game_versions: vec![ + "1.19".to_string(), + "1.19.1".to_string(), + "1.19.2".to_string() + ], + loaders: vec![ + "fabric".to_string() + ] + }]; + assert_eq!(download_updates(config, versions).await.unwrap(), "./dl") } diff --git a/src/config.rs b/src/config.rs index 58d399a..ad59963 100644 --- a/src/config.rs +++ b/src/config.rs @@ -4,6 +4,7 @@ use serde::Deserialize; #[derive(Debug, Clone, Deserialize)] pub struct Cfg { pub data: String, + pub downloads: String, pub clean_remove: bool, pub apis: Apis, } diff --git a/src/db.rs b/src/db.rs index 33d8344..497cc15 100644 --- a/src/db.rs +++ b/src/db.rs @@ -2,7 +2,7 @@ use std::io::ErrorKind; use crate::{Modloader, config::Cfg, List, modrinth::Version, get_modloader}; -//TODO use prepared statements +//TODO use prepared statements / change to rusqlite //MODS pub fn insert_mod(config: Cfg, id: String, name: String, versions: Vec) -> Result<(), sqlite::Error> { @@ -151,6 +151,27 @@ pub fn get_versions(config: Cfg, mods: Vec) -> Result Result> { + let data = format!("{}/data.db", config.data); + let connection = sqlite::open(data).unwrap(); + + let sql = format!("SELECT applicable_versions FROM {} WHERE mod_id = '{}'", list.id, mod_id); + + //TODO catch sql errors better + let mut version: String = String::new(); + connection.iterate(sql, |ver| { + if ver.is_empty() { return false; }; + for &(_column, value) in ver.iter() { + version = String::from(value.unwrap()); + } + true + }).unwrap(); + + if version.is_empty() { return Err(Box::new(std::io::Error::new(ErrorKind::Other, "NO_MODS_ON_LIST"))); }; + + Ok(version) +} + //LIST pub fn insert_list(config: Cfg, id: String, mc_version: String, mod_loader: Modloader) -> Result<(), sqlite::Error> { @@ -217,6 +238,15 @@ pub fn get_list(config: Cfg, id: String) -> Result, mod_id: String) -> Result<(), sqlite::Error> { + let data = format!("{}/data.db", config.data); + let connection = sqlite::open(data).unwrap(); + + let sql = format!("UPDATE {} SET current_version = '{}', applicable_versions = '{}' WHERE mod_id = '{}'", list.id, current_version, versions.join("|"), mod_id); + + connection.execute(sql) +} + //config pub fn change_list(config: Cfg, id: String) -> Result<(), sqlite::Error> { let data = format!("{}/data.db", config.data); diff --git a/src/input.rs b/src/input.rs index 0c13e67..e0c9ae9 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1,6 +1,7 @@ use std::io::{stdin, Error, ErrorKind}; use crate::{config::Cfg, list, modification, update}; +#[derive(Debug, PartialEq, Eq)] pub struct Input { pub command: String, pub args: Option>, @@ -27,8 +28,6 @@ impl Input { }, _ => { panic!("This should never happen") } } - - } } @@ -53,3 +52,10 @@ pub async fn get_input(config: Cfg) -> Result<(), Box> { _ => Err(Box::new(Error::new(ErrorKind::InvalidInput, "UNKNOWN_COMMAND"))), } } + +#[test] +fn input_from() { + let string = String::from("list add test 1.19.2 fabric"); + let input = Input { command: String::from("list"), args: Some(vec![String::from("add"), String::from("test"), String::from("1.19.2"), String::from("fabric")]) }; + assert_eq!(Input::from(string).unwrap(), input); +} diff --git a/tests/db/mod.rs b/tests/db/mod.rs index b5aed75..50e6887 100644 --- a/tests/db/mod.rs +++ b/tests/db/mod.rs @@ -1,5 +1,3 @@ -use std::fs::File; - pub fn setup() { - File::create("./setuptests").unwrap(); + //File::create("./setuptests").unwrap(); } diff --git a/tests/db_integration.rs b/tests/db_integration.rs index 82cfe0f..f580595 100644 --- a/tests/db_integration.rs +++ b/tests/db_integration.rs @@ -3,5 +3,4 @@ mod db; #[test] fn test_add() { db::setup(); - assert!(true); } -- cgit v1.2.3