Commit Graph

10 Commits

Author SHA1 Message Date
ef06c9c166 docs: document performance characteristics 2026-08-26 14:53:39 +02:00
688b3ca31b Merge pull request 'bugfix/BUG-1_empty_key_in_config_hangs_the_program' (#1) from bugfix/BUG-1_empty_key_in_config_hangs_the_program into main
Reviewed-on: #1
2026-08-26 12:46:01 +00:00
800ded7819 update 2026-08-26 14:45:11 +02:00
dc401be837 fix: reject a configuration entry with an empty value1
A line such as "=z" parsed into the pair ("", "z"). An empty value1
matches at every position and consumes nothing, so the scan in
replace_line never advanced and the program looped forever, printing
nothing and growing its output buffer until it was killed.

Reject the entry while parsing, reporting the offending line the same
way as a line with no "=" at all, and document the termination
invariant the loop depends on.
2026-08-26 14:35:32 +02:00
721d21a603 update 2026-08-25 22:10:56 +02:00
709d4ca60d chore: declare pytest in one place only 2026-08-25 22:10:25 +02:00
b39fd8f1d3 chore: keep the assignment brief out of the repository 2026-08-25 21:37:07 +02:00
5345684e1a refactor: drop redundant comment above the sort
The stable-sort behaviour is described in the Design decisions section
of the README.
2026-08-25 21:28:00 +02:00
03bec6404f docs: tighten example and merge input-handling decisions
Drop the verbatim config.txt and input.txt listings from the example;
both files are in the repository root. Merge the whitespace and line
terminator notes into a single input-handling decision.
2026-08-25 21:23:49 +02:00
40ea68be11 Initial implementation with unit and integration tests
Reads value1=value2 pairs from a configuration file and replaces every
non-overlapping occurrence of value1 with value2 in a text file, printing
the resulting lines sorted by the number of symbols replaced.

Overlapping patterns resolve to the longest match so the result does not
depend on configuration file ordering. Ties keep their original file order.
2026-08-25 21:21:38 +02:00