Skip to content

fix(test): correct implicit string concatenation in test_ship.py message arrays#163

Open
pankaj-bind wants to merge 1 commit into52North:mainfrom
pankaj-bind:fix/implicit-string-concat-test-ship-v2
Open

fix(test): correct implicit string concatenation in test_ship.py message arrays#163
pankaj-bind wants to merge 1 commit into52North:mainfrom
pankaj-bind:fix/implicit-string-concat-test-ship-v2

Conversation

@pankaj-bind
Copy link
Copy Markdown
Contributor

@pankaj-bind pankaj-bind commented Mar 7, 2026

Related Issue / Discussion:

Fixes #162

Changes:

  • Modified tests/test_ship.py - added missing comma in message array literal (2 occurrences)

Further Details:

Summary:

In both test_shipparams_get_element and test_shipparams_get_single, the message array was defined as:

message = np.array(['OK', 'OK', 'Error' 'OK'])

Python's implicit string concatenation silently merged 'Error' and 'OK' into 'ErrorOK', producing a 3-element array instead of the intended 4-element array. The tests still passed because the corrupted value round-tripped unchanged through ShipParams, masking the defect.

This fix adds the missing comma to restore ['OK', 'OK', 'Error', 'OK'] in both locations.

Dependencies:

None.

PR Checklist:

Copilot AI review requested due to automatic review settings March 7, 2026 18:18
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

Fixes a subtle Python test-data bug in tests/test_ship.py where implicit string concatenation ('Error' 'OK' -> 'ErrorOK') caused the message NumPy array to have the wrong number of elements, potentially masking defects in ShipParams-related tests.

Changes:

  • Add missing comma in message = np.array([...]) within test_shipparams_get_element.
  • Add missing comma in message = np.array([...]) within test_shipparams_get_single.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kdemmich kdemmich added the bug Something isn't working label Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(test): missing comma in test_ship.py causes implicit string concatenation in test data

3 participants