48 lines
1.3 KiB
Rust
48 lines
1.3 KiB
Rust
//! Basic compilation and infrastructure tests for dirigent_tools.
|
|
|
|
mod common;
|
|
|
|
use common::*;
|
|
|
|
#[test]
|
|
fn test_package_compiles() {
|
|
// Basic smoke test to ensure the package compiles
|
|
assert!(true);
|
|
}
|
|
|
|
#[test]
|
|
fn test_temp_dir_creation() {
|
|
let temp_dir = create_temp_dir();
|
|
assert!(temp_dir.path().exists());
|
|
assert!(temp_dir.path().is_dir());
|
|
}
|
|
|
|
#[test]
|
|
fn test_test_file_creation() {
|
|
let temp_dir = create_temp_dir();
|
|
let file_path = create_test_file(temp_dir.path(), "test.txt", "test content");
|
|
assert!(file_path.exists());
|
|
assert_eq!(read_file_content(&file_path), "test content");
|
|
}
|
|
|
|
#[test]
|
|
fn test_sandboxed_env_creation() {
|
|
let env = SandboxedTestEnv::new();
|
|
assert!(env.allowed_root.exists());
|
|
assert!(env.blocked_dir.exists());
|
|
assert!(env.outside_dir.path().exists());
|
|
}
|
|
|
|
#[test]
|
|
fn test_fixture_files_exist() {
|
|
// Verify test fixtures are present
|
|
let fixtures_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
|
.join("tests")
|
|
.join("test_fixtures");
|
|
|
|
assert!(fixtures_dir.join("sample_text.txt").exists());
|
|
assert!(fixtures_dir.join("unicode_text.txt").exists());
|
|
assert!(fixtures_dir.join("large_text.txt").exists());
|
|
assert!(fixtures_dir.join("README.md").exists());
|
|
}
|