Skip to content

Step 7: Tests #185

@thanos

Description

@thanos

Step 7: Tests

Create test/ex_data_sketch_ull_test.exs

  • Construction tests: default p, custom p, binary size 8 + 2^p, header fields, validation
  • Backend-parameterized tests: update, update_many, estimate accuracy (assert_in_delta 5% at p=14)
  • Merge tests: commutativity (state ==), identity, incompatible p raises
  • Serialize/deserialize round-trip
  • Property tests: merge commutativity, merge associativity, monotonicity, serialize round-trip
  • Cross-backend parity block (guarded by Backend.Rust.available?())

Modify test/parity_test.exs

  • Add describe "ULL parity" block with @describetag :rust_nif
  • Tests: update_many byte-identical serialization, merge byte-identical, estimate within 1.0e-9

Modify test/merge_laws_test.exs

  • Add ULL merge laws: commutativity (state==), associativity (state==), identity, chunking equivalence (1% delta)

Create test/vectors/ull/ directory with 4 JSON vectors:

  • empty.json, single.json, small_set.json, merge.json

Modify test/support/test_vectors.ex

  • Add normalize_opts("ull", ...) clause
  • Add sketch_module("ull") clause

Modify test/json_vector_test.exs

  • Add "ull" to the algo iteration list

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions