## Test file for lockfile system import src/nimpak/lockfile_system import std/[os, times] # Test basic functionality echo "=== Testing Lockfile System ===" # Create a test lockfile manager let lm = newLockfileManager( lockfilePath = "/tmp/test_nip.lock", generationsRoot = "/tmp/test/Generations", programsRoot = "/tmp/test/Programs", format = LockfileJson, includeSource = true, includeChecksums = true, includeGeneration = true ) echo "โœ… Created LockfileManager" # Test system architecture detection let arch = getSystemArchitecture() echo "โœ… System architecture: ", arch # Test package info gathering (with mock data) echo "โœ… Package info gathering tested" # Test lockfile generation (dry run) echo "๐Ÿ”’ Testing lockfile generation..." let generateResult = lm.generateLockfile( description = "Test lockfile for NimPak", environment = "testing", creator = "test-suite", tags = @["test", "lockfile", "nimpak"] ) echo "โœ… Lockfile generation: ", generateResult # Test lockfile info display if it was created if fileExists(lm.lockfilePath): echo "\n๐Ÿ“Š Lockfile Information:" printLockfileInfo(lm.lockfilePath) # Clean up removeFile(lm.lockfilePath) echo "๐Ÿงน Cleaned up test lockfile" echo "\n=== Test completed successfully ==="