feat: grep binary detection, awk %.6g and sorted for-in#240
Merged
Conversation
jaq's built-in `env` function reads from std::env::vars() which doesn't see bashkit's virtual environment. Fix: temporarily expose ctx.env and ctx.variables to the process environment before running jaq, with an RAII drop guard for cleanup on all return paths. - Unskip jq_env spec test - Add jq_env_missing and jq_env_in_pipeline spec tests - Add test_jq_env_access and test_jq_env_missing_var unit tests https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
Replace per-value empty inputs iterator with a shared RcIter over all parsed JSON values. Main loop and filter's input/inputs functions consume from the same source, matching real jq behavior. - Unskip jq_input and jq_inputs spec tests - Add jq_input_with_dot, jq_inputs_empty spec tests - Add 3 unit tests (input_reads_next, inputs_collects_remaining, inputs_single_value) https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
Grep: - Auto-detect binary content (null bytes without -a/-z flags) - Output "Binary file X matches" instead of raw lines - Unskip grep_binary_detect, add grep_binary_with_a_flag test AWK: - format_awk_number(): %.6g formatting (6 sig digits, trim trailing zeros) matching real awk OFMT behavior - Deterministic for-in: sort keys numerically then lexically - Unskip awk_exp_log_func and awk_for_in_array - Add awk_log_func and awk_for_in_string_keys tests Update specs/009-implementation-status.md with accurate counts: AWK 96/96, Grep 76/76, Sed 75/75, JQ 109/114, Bash 739/744 https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
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
-a(text) and-z(null-delimited) flagsformat_awk_number()implements C's%.6g(6 significant digits, trim trailing zeros) matching real awk OFMT4 previously-skipped tests unskipped, 4 new tests added.
Test plan
cargo clippy --all-targets --all-features -- -D warningscleancargo test --all-featuresall pass