mm(1): fixes bug with -a; mm.1, tests/mm.mk: changes to test regression in -a and -t
This commit is contained in:
19
tests/mm.mk
19
tests/mm.mk
@@ -1,10 +1,12 @@
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# Copyright (c) 2024–2025 Emma Tebibyte <emma@tebibyte.media>
|
||||
# SPDX-License-Identifier: FSFAP
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice and
|
||||
# this notice are preserved. This file is offered as-is, without any warranty.
|
||||
|
||||
MM_FILE!=mktemp /tmp/mm.XXXXXX
|
||||
|
||||
.PHONY: mm_tests
|
||||
mm_tests: mm_args mm_help mm_stderr mm_remaining mm_remaining_options
|
||||
|
||||
@@ -38,3 +40,18 @@ mm_remaining: $(BIN)/mm
|
||||
mm_remaining_options:
|
||||
! $(BIN)/mm -i README COPYING -o - 2>&1 | cut -d: -f2 \
|
||||
| xargs test " -o" =
|
||||
|
||||
.PHONY: mm_append
|
||||
mm_append:
|
||||
$(BIN)/mm -i /dev/null -o $(MM_FILE)
|
||||
printf 'test\nstring\nmulti-line\n' | $(BIN)/mm -o $(MM_FILE)
|
||||
printf 'new line\n' | $(BIN)/mm -a -o $(MM_FILE)
|
||||
$(BIN)/mm -i $(MM_FILE) | wc -l | xargs test 4 -eq
|
||||
|
||||
.PHONY: mm_no_truncate
|
||||
mm_no_truncate:
|
||||
$(BIN)/mm -i /dev/null -o $(MM_FILE)
|
||||
printf 'test\nstring\nmulti-line\n' | $(BIN)/mm -o $(MM_FILE)
|
||||
printf 'new line\n' | $(BIN)/mm -t -o $(MM_FILE)
|
||||
$(BIN)/mm -i $(MM_FILE) | wc -l | xargs test 3 -eq
|
||||
|
||||
|
||||
Reference in New Issue
Block a user