diff --git a/tests/bonsai/peek.mk b/tests/bonsai/peek.mk new file mode 100755 index 0000000..20e2e24 --- /dev/null +++ b/tests/bonsai/peek.mk @@ -0,0 +1,24 @@ +# Copyright (c) 2024 DTB +# 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. + +# Testing peek is hard as it requires visual confirmation that text isn't being +# echoed. These tests don't go that far but are a start, and have already +# caught a bug in -i behavior. + +.PHONY: peek_tests +peek_tests: peek_help peek_stdio + +.PHONY: peek_help +peek_help: $(BIN)/peek + ! $(BIN)/peek -h + +.PHONY: peek_stdio +# Test peek -i +peek_stdio: $(BIN)/peek + printf 'Test.\n' \ + | $(BIN)/peek -i \ + | xargs test 'Test.' =