From 369e260158e4fca1850736863eb0bdee0dbf8a34 Mon Sep 17 00:00:00 2001 From: Friday Date: Fri, 5 Jun 2026 14:45:49 +0000 Subject: [PATCH] Add 100-file volume test (subfolders + non-ASCII, 0 failures, no re-sync loop) Verifies the engine handles 100+ files in one sync without failures and that a follow-up sync is a clean no-op (no phantom re-uploads at volume). --- .../kotlin/com/syncflow/FullSyncEngineTest.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/src/androidTest/kotlin/com/syncflow/FullSyncEngineTest.kt b/app/src/androidTest/kotlin/com/syncflow/FullSyncEngineTest.kt index 2cfdb17..b0b72f4 100644 --- a/app/src/androidTest/kotlin/com/syncflow/FullSyncEngineTest.kt +++ b/app/src/androidTest/kotlin/com/syncflow/FullSyncEngineTest.kt @@ -253,6 +253,23 @@ class FullSyncEngineTest { assertTrue("my photo.txt" in names) } + // ── 13c. Volume: 100+ files (incl. subfolders & non-ASCII) upload, 0 fails ─ + @Test fun volume_hundredFiles_allUploadNoFailures() = runBlocking { + val (pair, local, remote) = newPair("vol100", SyncDirection.UPLOAD_ONLY, DeleteBehavior.KEEP) + repeat(100) { i -> write(local, "f_%03d.txt".format(i), "payload $i ".repeat(30)) } + write(local, "sub/nested_a.txt", "n1") + write(local, "sub/deep/nested_b.txt", "n2") + write(local, "naïve café.txt", "accented") + val r = sync(pair) + assertEquals("no file may fail under volume", 0, r.failedFiles) + assertEquals("all 103 files upload", 103, r.uploaded) + assertEquals("100 flat files present on cloud", 100, remoteNames(remote).count { it.startsWith("f_") }) + assertTrue("non-ASCII name present too", "naïve café.txt" in remoteNames(remote)) + // re-sync is a clean no-op (no phantom re-uploads / loops at volume) + val r2 = sync(pair) + assertEquals(0, r2.uploaded); assertEquals(0, r2.deleted); assertEquals(0, r2.failedFiles) + } + // ── 14. Content integrity: binary-ish bytes round-trip exactly ──────────── @Test fun contentIntegrity_roundTrip() = runBlocking { val (pair, local, remote) = newPair("integrity", SyncDirection.TWO_WAY)