Translate Types and Utilities tests exactly #14

Closed
opened 2026-08-08 08:13:45 +00:00 by hugo · 2 comments
Owner

Objective

Translate all upstream tests for UUID, math/value types, conversions, collections, caches, token bucket, locks, helpers, and utilities.

Deliverables

  • Preserve literal inputs, component order, endian cases, formatting/culture assumptions, tolerances, equality/hash expectations, and exception distinctions.
  • Translate parameterized NUnit cases into individually identifiable Rust cases.
  • Use only public APIs except documented friend/internal test cases placed in the owning crate.

Validation

  • All owned tests compile against signature shims.
  • Each case retains its upstream body hash and semantic-review marker.
  • Running fails only at owned unimplemented member IDs, not missing symbols or test harness errors.

Prerequisite

Milestone 02 must provide the complete callable public API shim. Keep all production behavior standardized as unimplemented.

Project constraints

  • Translate the original test semantics exactly; do not weaken assertions, tolerances, inputs, errors, ordering, or interaction expectations.
  • Tests must exercise the mapped Rust API and must never call LibreMetaverse/.NET as their implementation.
  • Expected C# exceptions map to specific Rust error variants; an unimplemented panic must remain a failure.
  • Do not implement production behavior during this milestone. Update parity metadata and handover status with the change.
## Objective Translate all upstream tests for UUID, math/value types, conversions, collections, caches, token bucket, locks, helpers, and utilities. ## Deliverables - Preserve literal inputs, component order, endian cases, formatting/culture assumptions, tolerances, equality/hash expectations, and exception distinctions. - Translate parameterized NUnit cases into individually identifiable Rust cases. - Use only public APIs except documented friend/internal test cases placed in the owning crate. ## Validation - All owned tests compile against signature shims. - Each case retains its upstream body hash and semantic-review marker. - Running fails only at owned unimplemented member IDs, not missing symbols or test harness errors. ## Prerequisite Milestone 02 must provide the complete callable public API shim. Keep all production behavior standardized as unimplemented. ## Project constraints - Translate the original test semantics exactly; do not weaken assertions, tolerances, inputs, errors, ordering, or interaction expectations. - Tests must exercise the mapped Rust API and must never call LibreMetaverse/.NET as their implementation. - Expected C# exceptions map to specific Rust error variants; an unimplemented panic must remain a failure. - Do not implement production behavior during this milestone. Update parity metadata and handover status with the change.
hugo added this to the 03 - Full semantic test translation milestone 2026-08-08 08:13:45 +00:00
hugo added the enhancement label 2026-08-08 08:13:45 +00:00
Author
Owner

Implemented and pushed in commit 1c0dfdc.

  • Translated all 17 NUnit cases owned by the Types/Utilities slice: UUID, vectors/quaternions/matrices, conversions, formatting, file/name helpers, observable callbacks, event subscriptions, repeat scheduling, disposal, positions, and reader/writer locking.
  • Preserved source case IDs, C# body hashes, literals, component order, Single.Epsilon behavior, exact tolerances, callback interactions, and concurrency gates.
  • Corrected the parity inventory to the 1,289 cases actually discovered by NUnit: five commented-out attributes are masked and a redundant [Test] on a parameterized [TestCase] method is not double-counted. Added regression coverage for both cases.
  • Mapped stored EventHandler and DictionaryChangeCallback values to cross-platform Arc<dyn Fn(...) + Send + Sync> callbacks while keeping generated production bodies standardized as unimplemented.
  • Left BitPacking, BitUnpacking, LLSDTerseParsing, and HelpersZeroCoding pending because they belong to later milestone issues. The pinned upstream has no additional cache/token-bucket NUnit cases.

Verification: cargo fmt --check; mapping/shim regeneration checks; API coverage; parity regeneration/audit (17 translated, 1,272 pending, zero drift); Python generator unit tests; cargo check workspace/all targets; downstream locked API fixture; cargo test --workspace --no-run; Clippy with -D warnings; cargo doc. A controlled run of the 17-case file is intentionally red and every case fails only at its owned standardized unimplemented C# member ID.

Implemented and pushed in commit 1c0dfdc. - Translated all 17 NUnit cases owned by the Types/Utilities slice: UUID, vectors/quaternions/matrices, conversions, formatting, file/name helpers, observable callbacks, event subscriptions, repeat scheduling, disposal, positions, and reader/writer locking. - Preserved source case IDs, C# body hashes, literals, component order, Single.Epsilon behavior, exact tolerances, callback interactions, and concurrency gates. - Corrected the parity inventory to the 1,289 cases actually discovered by NUnit: five commented-out attributes are masked and a redundant [Test] on a parameterized [TestCase] method is not double-counted. Added regression coverage for both cases. - Mapped stored EventHandler and DictionaryChangeCallback values to cross-platform Arc<dyn Fn(...) + Send + Sync> callbacks while keeping generated production bodies standardized as unimplemented. - Left BitPacking, BitUnpacking, LLSDTerseParsing, and HelpersZeroCoding pending because they belong to later milestone issues. The pinned upstream has no additional cache/token-bucket NUnit cases. Verification: cargo fmt --check; mapping/shim regeneration checks; API coverage; parity regeneration/audit (17 translated, 1,272 pending, zero drift); Python generator unit tests; cargo check workspace/all targets; downstream locked API fixture; cargo test --workspace --no-run; Clippy with -D warnings; cargo doc. A controlled run of the 17-case file is intentionally red and every case fails only at its owned standardized unimplemented C# member ID.
hugo closed this issue 2026-08-08 11:59:02 +00:00
hugo reopened this issue 2026-08-08 14:24:29 +00:00
Author
Owner

Implemented and verified in commit 7ac910d.

Translated all 17 NUnit invocations owned by #14 into explicit Rust #[test] bodies that call the mapped public APIs:

  • TypeTests: UUIDs, Vector3ApproxEquals, VectorCasting, Quaternions, TestMatrix, FloatsToTerseStrings
  • all 7 UtilUnitTests
  • both PositionHelperTests
  • ReaderWriterLockTests
  • UtilsConversionsTests.StringToBytes

The translation preserves the original literals, float epsilon/tolerances, value/operator distinctions, constructor overloads, callback behavior, cancellation flow, disposal failure/logging, concurrency gates/timeouts, and coordinate/string assertions. BitPacking/BitUnpacking and LLSDTerseParsing remain pending under #16 and #15 respectively; HelpersZeroCoding remains under #16.

Required callable shim corrections are cross-platform and failure-only: callable event/delegate replacements, dynamic string Object values, cancellable test tokens, C# value-type copy/default traits, disposal fakes, and a std-only test future runner. No production API behavior was implemented.

Verification:

  • parity: translated=17, pending=1272, drifted=0, exactly the #14 ownership set
  • focused compile: cargo test -p libremetaverse-compat-tests --test types_utilities --no-run
  • focused execution: 17/17 fail at exact owned NotImplemented C# member IDs
  • full workspace execution: all pre-existing tests pass; only the same 17 #14 semantic tests fail at NotImplemented IDs
  • fmt, mapping/shim regeneration checks, API coverage, surface/parity checks, Python unit tests, workspace/all-target checks, locked API compile, no-run test build, clippy -D warnings, and docs all pass
Implemented and verified in commit 7ac910d. Translated all 17 NUnit invocations owned by #14 into explicit Rust #[test] bodies that call the mapped public APIs: - TypeTests: UUIDs, Vector3ApproxEquals, VectorCasting, Quaternions, TestMatrix, FloatsToTerseStrings - all 7 UtilUnitTests - both PositionHelperTests - ReaderWriterLockTests - UtilsConversionsTests.StringToBytes The translation preserves the original literals, float epsilon/tolerances, value/operator distinctions, constructor overloads, callback behavior, cancellation flow, disposal failure/logging, concurrency gates/timeouts, and coordinate/string assertions. BitPacking/BitUnpacking and LLSDTerseParsing remain pending under #16 and #15 respectively; HelpersZeroCoding remains under #16. Required callable shim corrections are cross-platform and failure-only: callable event/delegate replacements, dynamic string Object values, cancellable test tokens, C# value-type copy/default traits, disposal fakes, and a std-only test future runner. No production API behavior was implemented. Verification: - parity: translated=17, pending=1272, drifted=0, exactly the #14 ownership set - focused compile: cargo test -p libremetaverse-compat-tests --test types_utilities --no-run - focused execution: 17/17 fail at exact owned NotImplemented C# member IDs - full workspace execution: all pre-existing tests pass; only the same 17 #14 semantic tests fail at NotImplemented IDs - fmt, mapping/shim regeneration checks, API coverage, surface/parity checks, Python unit tests, workspace/all-target checks, locked API compile, no-run test build, clippy -D warnings, and docs all pass
hugo closed this issue 2026-08-08 15:11:29 +00:00
Sign in to join this conversation.