nip/tests/test_sync_basic.nim

35 lines
961 B
Nim

## Basic test for sync engine compilation and core functionality
import ../src/nimpak/remote/sync_engine
# Test that we can create basic objects
proc testBasicFunctionality() =
echo "Testing basic sync engine functionality..."
# Test bloom filter creation
var filter = newBloomFilter(100, 0.01)
filter.add("test-hash")
if filter.contains("test-hash"):
echo "✓ Bloom filter basic operations work"
else:
echo "✗ Bloom filter test failed"
# Test bandwidth limiter
var limiter = newBandwidthLimiter(1000)
if limiter.checkBandwidth(500):
echo "✓ Bandwidth limiter works"
else:
echo "✗ Bandwidth limiter test failed"
# Test sync engine config
let config = getDefaultSyncEngineConfig()
if config.maxMirrors > 0:
echo "✓ Sync engine configuration works"
else:
echo "✗ Sync engine configuration test failed"
echo "Basic functionality tests completed"
when isMainModule:
testBasicFunctionality()