Commit graph

3 commits

Author SHA1 Message Date
dgaston 82887473d2 Utilities: Allow uniq to work on lines of arbitrary length
Calls to `read_line` are replaced with `read_line_with_resize`
and `swap`s of StringViews, which assume a consistent location
of the underlying ByteBuffers, are replaced. A test file has
been added for uniq, which includes a test case for long lines.
2024-04-27 16:33:27 -06:00
Shannon Booth 87e2b8e343 patch/Tests: Add some initial tests for patch utility 2023-07-29 17:09:09 -06:00
Rodrigo Tobar 150ffc7336 Tests: Add tests for sed utility
While the tests for sed itself are simple to begin with, some
infrastructure was needed to make them simple.

Firstly, there was no home for tests for the applications under
Utilities, so I had to create a new subdirectory under Tests to host
them.

Secondly, and more importantly, there was previously no easy way to
launch an executable and easily feed it with data for its stdin, then
read its stdout/err and exit code. Looking around the repo I found that
the JS tests do a very similar thing though, so I decided to adapt that
solution for these tests, but with the higher purpose of someday moving
this new Process class to LibCore/Process, where the existing spawn
helpers are still very low level, and there is no representation of a
Process object that one can easily interact with.

Note that this Process implementation is very simple, offers limited
functionality, and it doesn't use the EventLoop, so it can break on long
inputs/outputs depending on the executable behavior.
2023-04-09 18:09:23 -06:00