Skip to content

Conversation

@kris-gaudel
Copy link
Contributor

Added comprehensive unit tests for UX and Engine packages to improve test coverage and reliability.

Changes:

  1. UX Package:
  • Added tests for PrintVersion, PrintUsage, NewProgressWriter
  • Added tests for all tracker constructors (NewRuleTracker, NewProblemsTracker, etc.)
  • Added tests for error helpers and output functions
  • Added tests for utility functions like ProcessName, WriteDataSourceTemplate
  • Coverage increased from 8.0% to 32.0%
  1. Engine Package:
  • Fixed panic in StartLinesTracker by properly initializing UxEval instances
  • Added tests for New, AddRules, GetCre, Close, and Run functions
  • Added test cases for edge cases and error conditions
  • Coverage increased to 10.9%

Overall test coverage increased from 45.2% to 49.43%

@kris-gaudel
Copy link
Contributor Author

@tonymeehan Please lmk if you have feedback 👍🏼

}

// Helper function to check if a string contains a substring
func contains(s, substr string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure this is doing what we want. This would return true for s=AAAA and substr="B"

https://go.dev/play/p/iuYrKInn5BW

Should use strings.Contains(str, substr).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, idk how I missed this 😅

@kris-gaudel kris-gaudel requested a review from tonymeehan June 13, 2025 14:55
@tonymeehan tonymeehan merged commit bf850ab into prequel-dev:main Jun 16, 2025
2 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.

2 participants