Skip to content

Conversation

@Manahil-Afzal
Copy link

@Manahil-Afzal Manahil-Afzal commented Nov 22, 2025

This PR is attempting to solve following
Issue #352

Fixing Set up

WHAT I Have Done
-> Added complete white-box unit tests for the collision system.
-> Covered all main modules: Brute, QuadTree, and utils.
-> Ensured each module is tested under different collision scenarios.
-> Followed the required folder structure for the collision tests.

WHY I Did This
-> Collision detection is a core part of Music Blocks v4.
-> Tests ensure correctness, stability, and predictable behavior.
-> Helps avoid regressions in future updates.
-> Supports future contributors with a reliable foundation.

Summary of Changes:

Added tests for Brute.ts:
• Overlapping object detection
• Non-overlapping object detection

Added tests for QuadTree.ts:
• Object insertion
• Collision detection within regions

Added tests for utils/index.ts:
• Rectangle–rectangle collision
• Circle–circle collision

Organized files as follows:
📦collision
┣ 📂spec
┃ ┣ 📜Brute.spec.ts
┃ ┣ 📜index.spec.ts
┃ ┗ 📜QuadTree.spec.ts
┣ 📂utils
┃ ┗ 📜index.ts
┣ 📜Brute.ts
┣ 📜index.ts
┗ 📜QuadTree.ts
Start up

Please let me know if any improvements or additional test cases are required.
Thank you!

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.

1 participant