Skip to content

Conversation

@Jasrags
Copy link
Contributor

@Jasrags Jasrags commented May 20, 2025

Description

Expanded the test coverage of the character package to 24.3%, focused on functions that were simple to generate tests on.

@Jasrags Jasrags requested a review from Copilot May 20, 2025 03:00
@Jasrags Jasrags self-assigned this May 20, 2025
@Jasrags Jasrags requested a review from Volte6 as a code owner May 20, 2025 03:00
@Jasrags Jasrags added the enhancement New feature or request label May 20, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request primarily adds a comprehensive suite of tests for various features in the characters package and refactors some utility functions for improved clarity and maintenance.

  • Added tests for worn items, shop operations, mob masteries, formatted names, cooldown mechanics, charm information, character behavior, and alignment conversion.
  • Refactored several functions to use built-in slices and maps utilities (e.g., slices.Delete, maps.Copy, slices.Contains), and simplified some arithmetic expressions.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/characters/worn_test.go Added tests for verifying the behavior of Worn methods.
internal/characters/shop_test.go Introduced tests for Shop operations like stocking, destocking, and instock.
internal/characters/shop.go Updated destocking logic to use slices.Delete for list element removal.
internal/characters/mobmastery_test.go Added tests for mob mastery getters and setters.
internal/characters/formattedname_test.go Added tests for adjective formatting functions.
internal/characters/cooldowns_test.go Added tests covering cooldown decrementing and pruning behaviors.
internal/characters/cooldowns.go Simplified loop syntax in RoundTick by iterating directly over key values.
internal/characters/charminfo_test.go Added tests for charm creation and expiration.
internal/characters/character.go Refactored multiple functions to utilize built-in maps/slices utilities.
internal/characters/alignment_test.go Added tests for alignment-to-string conversion across different boundaries.

@Jasrags Jasrags changed the title Added tests to character package part 1 Added tests to character package May 20, 2025
Copy link
Member

@Volte6 Volte6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good cleanup as well (maps/slices).

@Jasrags Jasrags merged commit c0c0d34 into master May 21, 2025
6 checks passed
@Jasrags Jasrags deleted the character_test_coverage branch May 21, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants