Skip to content

[Tests] Deduplicate shared test case names#30

Merged
mrz1836 merged 1 commit into
masterfrom
feat/fix-issues-and-run-linter-tests-s38zyp
Oct 9, 2025
Merged

[Tests] Deduplicate shared test case names#30
mrz1836 merged 1 commit into
masterfrom
feat/fix-issues-and-run-linter-tests-s38zyp

Conversation

@mrz1836
Copy link
Copy Markdown
Collaborator

@mrz1836 mrz1836 commented Oct 9, 2025

What Changed

  • Introduced shared constants for recurring test case names in safe_conversion_test.go
  • Reused the new constants across all table-driven tests to eliminate repeated literals

Why It Was Necessary

  • SonarCloud flagged dozens of duplicated string literals across the conversion tests, impacting maintainability
  • Centralizing the labels improves readability and keeps future updates consistent

Testing Performed

  • golangci-lint run
  • go test ./...

Impact / Risk

  • No functional behavior changes; updates are limited to test code
  • Low risk: refactor only touches test naming and keeps expectations unchanged

https://chatgpt.com/codex/tasks/task_e_68e81bfe5a588321b70cbfcc13455b01

Copilot AI review requested due to automatic review settings October 9, 2025 20:48
Copy link
Copy Markdown

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 PR deduplicates test case names by introducing shared constants in safe_conversion_test.go. Previously, identical string literals like "zero value", "positive value", and "max uint32" were repeated across multiple table-driven tests.

  • Introduced 14 shared constants for common test case names
  • Replaced all hardcoded string literals with the corresponding constants across 20+ test functions
  • Maintained identical test behavior while improving maintainability

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions Bot added the size/L Large change (201–500 lines) label Oct 9, 2025
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Oct 9, 2025

@github-actions github-actions Bot added feature Any new significant addition test Unit tests, mocking, integration testing labels Oct 9, 2025
@mrz1836 mrz1836 merged commit 2815123 into master Oct 9, 2025
38 checks passed
@github-actions github-actions Bot deleted the feat/fix-issues-and-run-linter-tests-s38zyp branch October 9, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex feature Any new significant addition size/L Large change (201–500 lines) test Unit tests, mocking, integration testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants