Skip to content

fix: language breaking change#16

Merged
illusory0x0 merged 1 commit intomoonbit-community:masterfrom
illusory0x0:fix-bk
Jun 24, 2025
Merged

fix: language breaking change#16
illusory0x0 merged 1 commit intomoonbit-community:masterfrom
illusory0x0:fix-bk

Conversation

@illusory0x0
Copy link
Contributor

No description provided.

@peter-jerry-ye-code-review
Copy link

Changed failure function call from fail!() to fail()

Category
Correctness
Code Snippet
fail!("@lib.hello() != "Hello, world!"")
Recommendation
Verify that fail() is the correct function name in MoonBit's testing framework. If this is a breaking change, ensure all test files are updated accordingly.
Reasoning
The removal of the exclamation mark suggests either a syntax correction or an API change in the testing framework. Since this is a test assertion, it's critical to ensure the correct failure function is being used to properly report test failures.

Test error message contains redundant string literal

Category
Maintainability
Code Snippet
fail("@lib.hello() != "Hello, world!"")
Recommendation
Consider extracting the expected value into a constant:

let EXPECTED = "Hello, world!"
if @lib.hello() != EXPECTED {
  fail("Expected '${EXPECTED}' but got '${@lib.hello()}'")
}

Reasoning
The current error message duplicates the string literal. Using a constant and interpolated string would make the test more maintainable and provide better failure messages by showing both expected and actual values.

@illusory0x0 illusory0x0 merged commit b1d694c into moonbit-community:master Jun 24, 2025
15 checks passed
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