ld-so-cache 0.1.0

A parser for glibc ld.so.cache files
Documentation
# Testing

This directory contains tests for the ld.so.cache parser, including comprehensive snapshot tests using real system cache files.

## Test Structure

- `fixtures/` - Contains test data files
  - `system-ld.so.cache` - A real ld.so.cache file from the system (used for snapshot testing)
- `complete_snapshot_test.rs` - Comprehensive snapshot tests that capture ALL cache data
- `snapshots/` - Contains generated snapshot files:
  - `complete_cache_data.snap` (898KB) - Full cache structure with metadata and all entries
  - `complete_parsed_entries.snap` (831KB) - All 2412 parsed entries with decoded flags
  - `raw_entries.snap` (490KB) - Raw entry data with exact offsets and values

## Running Tests

```bash
# Run all tests
cargo test

# Run only snapshot tests
cargo test --test complete_snapshot_test

# Update snapshots if the output changes (after verifying the changes are correct)
cargo insta review
```

## Snapshot Tests

The snapshot tests use the `insta` crate to capture and verify the complete parser output. This ensures that:

1. The parser can handle real system cache files with 2400+ entries
2. Every single bit of data in the cache is captured and verified
3. Changes to the parser don't break existing functionality
4. The output format remains consistent

The snapshots capture:
- Complete cache statistics and metadata
- All 2412 library entries with full details
- Raw entry data including offsets, flags, and hwcap values
- Decoded flag values (architecture, ELF type)
- Hardware capability decoding
- Extension directory information

## Test Coverage

The tests verify:
- Parsing of real system cache files (2412 entries)
- Correct handling of absolute string offsets (57936 byte offset)
- Proper extraction of all library names and paths
- Flag interpretation (ELF type, x86_64/i386/libx32 architectures)
- Hardware capability information (all entries have hwcap)
- Presence of common system libraries (libc, libm, libdl, libpthread)
- Complete data integrity - every field in every entry is captured