Initial GPL-3.0 Release (v1.0.0)

This commit is contained in:
2026-01-22 21:29:34 -05:00
commit 9c8d1d43fd
23 changed files with 4087 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
use assert_cmd::prelude::*;
use predicates::prelude::*;
use std::fs::File;
use std::io::Write;
use std::process::Command;
use tempfile::TempDir;
#[test]
fn test_basic_cli_run() {
let mut cmd = Command::new(env!("CARGO_BIN_EXE_sized"));
cmd.arg("--version")
.assert()
.success()
.stdout(predicate::str::contains("sized 1.0.0"));
}
#[test]
fn test_run_on_directory() {
let temp_dir = TempDir::new().unwrap();
let file_path = temp_dir.path().join("test_file.txt");
File::create(&file_path)
.unwrap()
.write_all(b"Hello")
.unwrap();
let mut cmd = Command::new(env!("CARGO_BIN_EXE_sized"));
cmd.arg(temp_dir.path())
.assert()
.success()
.stdout(predicate::str::contains("test_file.txt")); // Basic check
}
#[test]
fn test_json_output() {
let temp_dir = TempDir::new().unwrap();
let file_path = temp_dir.path().join("data.json");
File::create(&file_path).unwrap().write_all(b"{}").unwrap();
let mut cmd = Command::new(env!("CARGO_BIN_EXE_sized"));
cmd.arg(temp_dir.path())
.arg("--format")
.arg("json")
.assert()
.success()
.stdout(predicate::str::contains("\"entry_type\":\"File\""))
.stdout(predicate::str::contains("\"path\":"));
}