This commit is contained in:
2025-09-27 07:23:01 +04:00
parent ba1ca13066
commit 2bea94eb89
4 changed files with 7 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
module herofs module herofs
import freeflowuniverse.herolib.hero.db import freeflowuniverse.herolib.hero.herofs { new_test }
fn test_cleanup() ! { fn test_cleanup() ! {
delete_fs_test()! delete_fs_test()!
@@ -14,7 +14,7 @@ fn test_basic() ! {
test_cleanup()! test_cleanup()!
// Initialize the HeroFS factory for test purposes // Initialize the HeroFS factory for test purposes
mut fs_factory := new()! mut fs_factory := new_test()!
// Create a new filesystem // Create a new filesystem
mut test_fs := fs_factory.fs.new_get_set( mut test_fs := fs_factory.fs.new_get_set(
@@ -22,7 +22,7 @@ fn test_basic() ! {
description: 'Filesystem for testing FsBlobMembership functionality' description: 'Filesystem for testing FsBlobMembership functionality'
quota_bytes: 1024 * 1024 * 1024 // 1GB quota quota_bytes: 1024 * 1024 * 1024 // 1GB quota
)! )!
assert test_fs.id > 0 assert test_fs.id > 0
assert test_fs.root_dir_id > 0 assert test_fs.root_dir_id > 0
@@ -55,7 +55,7 @@ fn test_filesystem_operations() ! {
test_cleanup() or { panic('cleanup failed: ${err.msg()}') } test_cleanup() or { panic('cleanup failed: ${err.msg()}') }
} }
// Initialize the HeroFS factory for test purposes // Initialize the HeroFS factory for test purposes
mut fs_factory := new()! mut fs_factory := new_test()!
// Create filesystems for testing // Create filesystems for testing
mut fs1 := fs_factory.fs.new_get_set( mut fs1 := fs_factory.fs.new_get_set(
@@ -127,7 +127,7 @@ fn test_validation() ! {
test_cleanup() or { panic('cleanup failed: ${err.msg()}') } test_cleanup() or { panic('cleanup failed: ${err.msg()}') }
} }
// Initialize the HeroFS factory for test purposes // Initialize the HeroFS factory for test purposes
mut fs_factory := new()! mut fs_factory := new_test()!
// Create a filesystem for validation tests // Create a filesystem for validation tests
mut test_fs := fs_factory.fs.new_get_set( mut test_fs := fs_factory.fs.new_get_set(
@@ -151,4 +151,4 @@ fn test_validation() ! {
return return
} }
panic('Validation should have failed for non-existent blob') panic('Validation should have failed for non-existent blob')
} }

View File

@@ -20,7 +20,7 @@ fn test_fs_blob_new() ! {
assert blob.data == 'Hello World!'.bytes() assert blob.data == 'Hello World!'.bytes()
assert blob.size_bytes == 12 assert blob.size_bytes == 12
assert blob.hash == 'a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b27796d9ad9587' assert blob.hash == '5ca7815adcb484e9a136c11efe69c1d530176d549b5d18d0'
assert blob.updated_at > 0 assert blob.updated_at > 0
println(' FsBlob new test passed!') println(' FsBlob new test passed!')