From f7a8158347623fd41caa63e0619055ed4543e2cf Mon Sep 17 00:00:00 2001 From: DTB Date: Sat, 31 Aug 2024 22:22:06 -0600 Subject: [PATCH] tests: bonsai/peek.mk --- tests/bonsai/peek.mk | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 tests/bonsai/peek.mk 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.' =