From 3c8a8cd57a91d967f0d7598921b0dd3475dcede8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 18 Aug 2018 18:39:40 +0100 Subject: [PATCH] Scaffolding of a test --- README.md | 5 +++++ src/main.rs | 30 ++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6c7b96f..fd022fe 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,9 @@ Goals: * memory usage limit * encryption by default - asymmetric, creates a keypair for you * deduplication +* fuzzy find by file name in stored files +Implementation: +* hash -> file and file -> hash indexes +* use vfs to store both db and data files, create a new one when old one too big +* start with simple read file -> hash -> encrypt -?> send \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 3f38c98..22925b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,27 @@ -fn main() { - println!("Hello, world!"); -} -#[cfg(test)] -mod should { - #[test] - fn hash_scanned_files(){ +mod index { + use super::*; + + #[cfg(test)] + mod should { + + #[test] + fn recognize_files_of_same_contents() { + let file_source = FileSource::new(); + + file_source.add("file name 1", "file contents 1"); + file_source.add("file name 2", "file contents 1"); + file_source.add("file name 3", "file contents 3"); + + let contents_hasher = FakeContentsHasher::default(); + + + let index = Index::with(file_source, contents_hasher); + + + } } -} \ No newline at end of file +}