Skip to content

Commit

Permalink
test: made tests more verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
AbsoluteZero000 committed Oct 6, 2024
1 parent 9494e15 commit d903d82
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 4 deletions.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
**Crunch: Your Data Compression Powerhouse**

**Introduction**

Crunch is a robust command-line tool written in Go that empowers you to achieve efficient data compression using the venerable Huffman coding algorithm. It streamlines the process, making it a breeze to compress your files while maintaining clarity and control.

**Features**

- **Lossless Compression:** Crunch preserves the integrity of your data, ensuring an exact reconstruction upon decompression.
- **Customizable Verbosity:** Control the level of detail displayed during compression with the `-v` flag, allowing you to tailor the output to your preferences.
- **Streamlined File Handling:** Crunch seamlessly handles both input and output files, making compression workflows effortless.

** Usage **

1. **Basic Usage:**
```bash
crunch -i input.txt -o compressed.dat
```
This command compresses `input.txt` and stores the compressed data in `compressed.dat`.

2. **Example with Verbose Mode**

```bash
crunch -i sample_data.txt -o encoded.dat -v
```

This example compresses `sample_data.txt` while providing informative progress messages about the compression process.

**Contributing**

We welcome contributions to Crunch! Feel free to fork the repository on GitHub (link coming soon) and submit pull requests for bug fixes, enhancements, or documentation improvements.

**License**

Crunch is distributed under the MIT License (see LICENSE file).

**Disclaimer**

While Crunch offers effective compression, some file types might not experience significant size reduction due to inherent redundancies within the data itself.

**Future Enhancements**

- Support for multiple compression algorithms (e.g., LZMA)
- Integration with popular archive management tools
- Decompression functionality (coming soon)

**I appreciate your interest in Crunch!**

4 changes: 2 additions & 2 deletions tests/seralization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ func TestSeralization(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
serialized, err := huffman.SerializeTree(tc.root)
if err != nil {
t.Errorf("Deserialization failed")
t.Errorf("Serialization failed")
}
root, err := huffman.DeserializeTree(serialized)
if err != nil {
t.Errorf("Deserialization failed")
}
if !checkIfEqual(tc.root, root) {
t.Errorf("Deserialization failed")
t.Errorf("The tree generated from the deserialization is not equal to the original tree")
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions todo.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- add lipgloss to make it look better
- add a serialization function for the table and the encoded data
✔️ add lipgloss to make it look better
✔️ add a serialization function for the table and the encoded data
- use charmbracelet/vhs to make a cool README file

0 comments on commit d903d82

Please sign in to comment.