Commit Graph

99 Commits

Author SHA1 Message Date
Adam Hathcock
f34ed8bd94 first commit for conslidating publci api 2026-03-06 11:22:09 +00:00
Adam Hathcock
eb844e8016 Fixed some exception tests 2026-02-16 16:29:20 +00:00
Adam Hathcock
855d4b4ce2 Use more SC exceptions instead of generic ones 2026-02-16 12:40:07 +00:00
Adam Hathcock
4ab03c0093 fixed more 2026-02-16 09:27:06 +00:00
Adam Hathcock
5263f43c29 more nulls and a namespace folder fix 2026-02-13 15:01:12 +00:00
Adam Hathcock
26d49198f0 Merge remote-tracking branch 'origin/master' into adam/fix-editorconfig-errors
# Conflicts:
#	src/SharpCompress/Common/Zip/ZipFilePart.cs
#	src/SharpCompress/Compressors/BZip2/BZip2Stream.cs
2026-02-13 14:23:42 +00:00
Adam Hathcock
5a319ffe2c create/open always has to be async for detection 2026-02-12 10:18:43 +00:00
Adam Hathcock
99d8eb9265 some build fixes 2026-02-11 11:04:25 +00:00
Adam Hathcock
cf0ad9b323 Merge remote-tracking branch 'origin/copilot/fix-rar-extraction-issues' into adam/cleanup-options 2026-02-09 17:30:50 +00:00
Adam Hathcock
04dd177f19 first pass of removing extraction options (folded into reader options) 2026-02-09 16:52:54 +00:00
Adam Hathcock
c4a28e7cfb Update tests/SharpCompress.Test/Rar/RarArchiveAsyncTests.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-09 09:11:19 +00:00
Adam Hathcock
29197f2142 Update tests/SharpCompress.Test/Rar/RarArchiveTests.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-09 09:10:59 +00:00
copilot-swe-agent[bot]
d5cab8172b Address code review feedback: clarify file size comment
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-02-08 12:54:11 +00:00
copilot-swe-agent[bot]
4084b347d4 Fix RAR extraction to preserve subdirectory structure
- Set default ExtractFullPath=true in WriteToDirectoryInternal methods
- Add test case with sample RAR archive containing subdirectories
- Tests verify files are extracted to correct subdirectories, not root

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-02-08 12:52:25 +00:00
Adam Hathcock
642b8bddb8 fixed merge 2026-02-04 14:41:55 +00:00
Adam Hathcock
27f7221902 Merge remote-tracking branch 'origin/release' into adam/release-merge
# Conflicts:
#	Directory.Packages.props
#	build/packages.lock.json
#	src/SharpCompress/Common/Zip/WinzipAesEncryptionData.cs
#	src/SharpCompress/SharpCompress.csproj
#	src/SharpCompress/packages.lock.json
#	tests/SharpCompress.Performance/packages.lock.json
#	tests/SharpCompress.Test/SharpCompress.Test.csproj
#	tests/SharpCompress.Test/packages.lock.json
2026-02-04 14:35:40 +00:00
copilot-swe-agent[bot]
ad7e64ba43 Fix test to use correct RarArchive API - all RAR tests passing
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-02-02 09:33:37 +00:00
copilot-swe-agent[bot]
8737b7a38e Apply infinite loop fix to SourceStream.cs and add test case
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-02-02 09:31:38 +00:00
Adam Hathcock
44174e7b03 some fixes 2026-01-20 09:07:57 +00:00
copilot-swe-agent[bot]
0de5c59a77 Restore AsyncOnlyStream in archive async tests as requested
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-01-16 09:50:36 +00:00
copilot-swe-agent[bot]
c7da19f3a5 Format code with CSharpier
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-01-16 09:26:04 +00:00
copilot-swe-agent[bot]
e919930cf6 Fix Archive async tests to not use AsyncOnlyStream (archives need seekable streams)
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-01-16 09:23:32 +00:00
copilot-swe-agent[bot]
2906529080 Fix ReaderFactory.OpenAsyncReader to use async IsArchiveAsync methods
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-01-16 09:12:54 +00:00
Adam Hathcock
ec310c87de merge fixes and fmt 2026-01-15 15:20:52 +00:00
Adam Hathcock
c55a383112 Merge remote-tracking branch 'origin/master' into adam/async-again
# Conflicts:
#	tests/SharpCompress.Test/GZip/GZipReaderAsyncTests.cs
#	tests/SharpCompress.Test/Rar/RarArchiveAsyncTests.cs
#	tests/SharpCompress.Test/SevenZip/SevenZipArchiveAsyncTests.cs
#	tests/SharpCompress.Test/Tar/TarArchiveAsyncTests.cs
#	tests/SharpCompress.Test/Tar/TarReaderAsyncTests.cs
#	tests/SharpCompress.Test/Zip/Zip64AsyncTests.cs
#	tests/SharpCompress.Test/Zip/ZipMemoryArchiveWithCrcAsyncTests.cs
2026-01-15 15:18:05 +00:00
Adam Hathcock
779fba5deb finish the open refactor? 2026-01-15 12:06:54 +00:00
Adam Hathcock
7b76858ae1 refactoring naming again 2026-01-15 11:41:30 +00:00
Adam Hathcock
ebfa16f09f more test fixes 2026-01-14 14:12:53 +00:00
Adam Hathcock
0502ff545e test fixes and fmt 2026-01-12 15:01:29 +00:00
Adam Hathcock
fce4a96718 make Writable interfaces for archive 2026-01-12 14:57:13 +00:00
Adam Hathcock
38203fb950 Fix async reader variable types - Remove double await on ReaderFactory.OpenAsync and use IAsyncReader
- Removed 'await' keyword before ReaderFactory.OpenAsync() calls since the method returns IAsyncReader directly (not Task)
- Changed ZipReader.Open() to ReaderFactory.OpenAsync() in Zip64AsyncTests.ReadForwardOnlyAsync()
- Changed TarReader.Open() to ReaderFactory.OpenAsync() in TarReaderAsyncTests.Tar_BZip2_Entry_Stream_Async()
- Fixed EntryStream disposal from 'await using' to 'using' since EntryStream doesn't implement IAsyncDisposable
- These changes fix compilation errors where async methods were being called on IReader (synchronous) instead of IAsyncReader (asynchronous)
2026-01-12 14:14:46 +00:00
Adam Hathcock
17cd934b5b use async methods where we can 2026-01-08 16:24:11 +00:00
Adam Hathcock
3747a27109 Task to ValueTask 2026-01-08 12:35:12 +00:00
Adam Hathcock
7aec98d652 read async interface for reader 2026-01-08 11:28:15 +00:00
copilot-swe-agent[bot]
41ed4c8186 Add negative test case for premature stream termination
Added Rar_StreamValidation_ThrowsOnTruncatedStream test that verifies InvalidOperationException IS thrown when a RAR stream ends prematurely (position < expected length). Created TruncatedStream mock to simulate corrupted/truncated RAR files. This test validates the exception condition (_position < Length) works correctly.

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-01-04 11:47:57 +00:00
copilot-swe-agent[bot]
90a33ce6b0 Remove duplicate test that doesn't verify exception case
Removed Rar_StreamValidation_CorrectExceptionBehavior test as it duplicated the validation in Rar_StreamValidation_OnlyThrowsOnPrematureEnd without actually testing the exception case. The remaining test adequately validates that the fix works correctly across multiple RAR formats.

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-01-04 11:36:25 +00:00
copilot-swe-agent[bot]
12574798e1 Update test to document exception behavior for RAR stream validation
Renamed and enhanced the test to better document the fix. Added second test (Rar_StreamValidation_CorrectExceptionBehavior) that explicitly validates the difference between old and new behavior. Tests verify that InvalidOperationException is only thrown when position < expected length (premature termination), not when position >= expected length (which can be valid for some RAR files).

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-01-04 09:55:18 +00:00
copilot-swe-agent[bot]
83b11254db Add test for InvalidOperationException fix in RAR extraction
Added Rar_ExtractionCompletesWithoutInvalidOperationException test that verifies RAR extraction completes successfully without throwing InvalidOperationException when reading streams to EOF. The test validates the fix works across RAR, RAR5, RAR4, and RAR2 formats by reading all entries completely and ensuring no exceptions are thrown.

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
2026-01-04 09:33:31 +00:00
HeroponRikIBestest
e0660e7775 Add tests 2025-12-02 09:55:24 -05:00
Adam Hathcock
5bf789ac65 Update csharpier and reformat 2025-11-25 11:50:21 +00:00
Adam Hathcock
ccc8587e5f review fixes 2025-10-31 10:55:33 +00:00
Adam Hathcock
a0c5b1cd9d add archive tests 2025-10-29 09:08:08 +00:00
Adam Hathcock
8e7d959cf4 add async creations 2025-10-28 16:07:16 +00:00
Adam Hathcock
084fe72b02 Consolidate not null 2025-10-22 09:17:13 +01:00
Adam Hathcock
f1a80da34b fix tests that use extract all wrongly 2025-10-21 09:56:29 +01:00
Adam Hathcock
88cd6bfd1a Merge remote-tracking branch 'origin/master' into update-deps 2025-06-03 08:13:41 +01:00
Morilli
6e51967993 format 2025-05-14 11:42:52 +02:00
Morilli
7989ab2e28 modify now-broken test
This test tested that skipping over entries using the reader interface for an encrypted multi-volume rar archive worked.
However reading those entries doesn't work and the skipping was also not working properly so I believe it's fine to "break" this functionality.
2025-05-14 11:18:41 +02:00
Morilli
c0cd998836 add failing test 2025-05-14 10:27:30 +02:00
Adam Hathcock
e7417e35ba Update dependencies and csharpier 2025-04-28 16:18:01 +01:00