Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test: add CodeHighlighter unit tests #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

@MihaiCristianCondrea
Copy link
Owner

@MihaiCristianCondrea MihaiCristianCondrea commented Sep 14, 2025

Summary

  • add unit tests for CodeHighlighter Java and XML themes

Testing

  • ./gradlew test (fails: SDK location not found)

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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

return null;
}).when(codeView).addSyntaxPattern(any(Pattern.class), anyInt());

CodeHighlighter.applyJavaTheme(codeView);
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot Sep 14, 2025

Choose a reason for hiding this comment

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

[P1] Guard unit tests against Android Color dependency

Running CodeHighlighter.applyJavaTheme(codeView) in a local unit test invokes android.graphics.Color.parseColor, but the project’s test configuration only includes plain JUnit/Mockito and no Robolectric or Android runtime stubs. When ./gradlew test executes, this call will throw RuntimeException: Method parseColor in android.graphics.Color not mocked before any assertions run (same for applyXmlTheme later in the file), causing the entire test task to fail. Consider moving these tests under androidTest, adding Robolectric, or mocking the color parsing so the tests can execute in a JVM environment.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /