Skip to content

Fix AST processor tests: handle files.LanguageContent type assertions#3

Open
bernardoforcillo wants to merge 1 commit into
mainfrom
fix-ast-processor-tests-18084114665363459455
Open

Fix AST processor tests: handle files.LanguageContent type assertions#3
bernardoforcillo wants to merge 1 commit into
mainfrom
fix-ast-processor-tests-18084114665363459455

Conversation

@bernardoforcillo
Copy link
Copy Markdown
Owner

This PR fixes the skipped tests TestASTProcessorErrorHandling and TestASTProcessorWithNestedObjects in internal/processor/tests/processor_deep_test.go.

The tests were failing because they asserted that nested maps in the result were of type map[string]interface{}, but ASTProcessor.Execute returns files.LanguageContent (which is a defined type based on map[string]interface{}).

Changes:

  • Unskipped TestASTProcessorErrorHandling and TestASTProcessorWithNestedObjects.
  • Added a helper function castToLanguageContent to robustly cast values to files.LanguageContent, handling both files.LanguageContent and map[string]interface{} types.
  • Refactored the tests to use this helper function.

This ensures that the tests correctly verify the error handling and nested object processing behavior of the AST processor.


PR created automatically by Jules for task 18084114665363459455 started by @bernardoforcillo

Unskipped TestASTProcessorErrorHandling and TestASTProcessorWithNestedObjects in internal/processor/tests/processor_deep_test.go.
Fixed type assertion failures by handling files.LanguageContent type correctly using a helper function castToLanguageContent.
Ensured that tests pass and verify the expected behavior of ASTProcessor when translations fail or when handling nested objects.

Co-authored-by: bernardoforcillo <28314446+bernardoforcillo@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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