From 77be4a1757fae1dc254b18e744e169ae74bf9828 Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou Date: Fri, 13 Sep 2024 07:55:07 +0200 Subject: [PATCH] rename core_tester -> test --- {core_tester => test}/Cargo.toml | 6 +++--- {core_tester => test}/README.md | 0 {core_tester => test}/reset.sh | 5 +++-- core_tester/src/main.rs => test/src/lib.rs | 14 ++++---------- 4 files changed, 10 insertions(+), 15 deletions(-) rename {core_tester => test}/Cargo.toml (89%) rename {core_tester => test}/README.md (100%) rename {core_tester => test}/reset.sh (79%) rename core_tester/src/main.rs => test/src/lib.rs (94%) diff --git a/core_tester/Cargo.toml b/test/Cargo.toml similarity index 89% rename from core_tester/Cargo.toml rename to test/Cargo.toml index 9a70d1f53..277f895cb 100644 --- a/core_tester/Cargo.toml +++ b/test/Cargo.toml @@ -7,9 +7,9 @@ license.workspace = true repository.workspace = true description = "Internal tester of write path" -[[bin]] -name = "core_tester" -path = "src/main.rs" +[lib] +name = "test" +path = "src/lib.rs" [dependencies] diff --git a/core_tester/README.md b/test/README.md similarity index 100% rename from core_tester/README.md rename to test/README.md diff --git a/core_tester/reset.sh b/test/reset.sh similarity index 79% rename from core_tester/reset.sh rename to test/reset.sh index e5b81a884..8f304e55b 100755 --- a/core_tester/reset.sh +++ b/test/reset.sh @@ -2,7 +2,8 @@ set -ex export RUST_BACKTRACE=1 -rm test.db -f -rm query-log.log -f +rm -f test.db +rm -f query-log.log # for now only integer primary key supported +touch test.db echo "create table test (x INTEGER PRIMARY KEY);" | tee -a query-log.log | sqlite3 test.db diff --git a/core_tester/src/main.rs b/test/src/lib.rs similarity index 94% rename from core_tester/src/main.rs rename to test/src/lib.rs index 50c793bdb..aae7bbae9 100644 --- a/core_tester/src/main.rs +++ b/test/src/lib.rs @@ -39,7 +39,10 @@ mod tests { .output() .expect("failed to execute process"); println!("finished creating db {:?}", result.stdout); - println!("finished creating db {:?}", result.stderr); + println!( + "finished creating db {:?}", + String::from_utf8(result.stderr) + ); let db = Database::open_file(io.clone(), path)?; let conn = db.connect(); @@ -96,13 +99,4 @@ mod tests { } Ok(()) } - - #[test] - fn simple_test() { - assert_eq!(2 + 2, 4); - } -} - -fn main() -> anyhow::Result<()> { - Ok(()) }