tests, Makefile: cleaning up

This commit is contained in:
2024-08-09 23:50:31 -06:00
parent 66f809162b
commit b76ff8fd90
5 changed files with 14 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ fop_help: $(BIN)/fop
.PHONY: fop_delimiter
fop_delimiter: $(BIN)/fop
test "$$(printf 'test1 test1 test1\n' | $(BIN)/fop -d' ' 2 sed 's/2/4/g')" \
test "$$(printf 'test1 test1 test1\n' | $(BIN)/fop -d' ' 2 sed 's/1/4/g')" \
= 'test1 test1 test4'
test "$$(printf 'meowsetwoofsetribbit\n' \
| $(BIN)/fop -d 'set' 1 sed 's/woof/meow/g')" = 'meowsetmeowsetribbit'

View File

@@ -6,7 +6,7 @@
# notice are preserved. This file is offered as-is, without any warranty.
.PHONY: hru_tests
hru_tests: hru_help hru_functionality hru_negative hru_regression
hru_tests: hru_help hru_functionality hru_negative hru_regressions
.PHONY: hru_help
hru_help: $(BIN)/hru
@@ -14,8 +14,8 @@ hru_help: $(BIN)/hru
.PHONY: hru_functionality
hru_functionality: $(BIN)/hru
test "$(printf '1234\n' | $(BIN)/hru)" = '1.2 kB'
test "$(printf '0\n' | $(BIN)/hru)" = '0 B'
test "$$(printf '1234\n' | $(BIN)/hru)" = '1.2 kB'
test "$$(printf '0\n' | $(BIN)/hru)" = '0 B'
.PHONY: hru_negative
hru_negative: $(BIN)/hru
@@ -25,7 +25,8 @@ hru_negative: $(BIN)/hru
hru_regressions: $(BIN)/hru
n=1; \
while true; \
do n="$$(($$n * 10))"; \
do \
printf '%s\n' "$$n" | $(BIN)/hru || break; \
n="$$(($$n * 10))"; \
done; \
printf 'Max float: %s\n' "$$n"

View File

@@ -24,4 +24,4 @@ mm_help: $(BIN)/mm
.PHONY: mm_stderr
# check if stderr is empty upon specifying -e
mm_stderr: $(BIN)/mm
! test "$$(printf 'test\n' | $(BIN)/mm -i - -e 2>&1 >/dev/null)" = "test"
! test "$$(printf 'test\n' | $(BIN)/mm -e 2>&1 >/dev/null)" = "test"