Fix 3 failing object-formatting tests in non-TTY environments#35
Merged
Conversation
…TTY environments The `colored` crate disables ANSI codes when stdout is not a TTY (as in test runners). Tests that assert on colored key output now call `colored::control::set_override(true)` before formatting and reset with `unset_override()` after, so they reliably exercise the color code path. https://claude.ai/code/session_01FHd1Nx228QwtR5sGowP7mN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
coloredcrate disables ANSI codes when stdout is not a TTY (e.g. in test runners), causing the three object-formatting tests to fail because their expected strings included ANSI color codes.colored::control::set_override(true)before formatting andunset_override()after in each affected test to force color output regardless of environment.Tests affected
nodes::object::object_tests::it_formats_an_objectnodes::object::object_tests::it_formats_a_multidimensional_objectformatter::json_formatter_tests::it_formats_an_objectTest plan
cargo testpasses with 30/30 tests greenGenerated by Claude Code