Skip to content

Add core Huffman test coverage#6

Open
nexiumbiz-debug wants to merge 1 commit into
kelreel:masterfrom
nexiumbiz-debug:add-core-test-coverage
Open

Add core Huffman test coverage#6
nexiumbiz-debug wants to merge 1 commit into
kelreel:masterfrom
nexiumbiz-debug:add-core-test-coverage

Conversation

@nexiumbiz-debug
Copy link
Copy Markdown

@nexiumbiz-debug nexiumbiz-debug commented May 17, 2026

Summary

  • Add broader tests around core Huffman encode/decode behavior.
  • Cover empty input, repeated-symbol input, punctuation/whitespace text, frequency helpers, relative frequencies, entropy, tree root weights, unique generated codes, and prefix-free codes.

Testing

  • npm test (11 tests passed)
  • node -e "const core=require('./packages/core/dist'); const text='hello, huffman!'; const codes=core.getCharCodesFromSource(text); const encoded=core.encode(text,codes); const decoded=core.decode(encoded,codes); if(decoded!==text) throw new Error('round trip failed'); console.log('manual core round-trip ok');"

Closes #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests?

1 participant