From a94884cc2ade776a86056bfa7e7716aa2674bf50 Mon Sep 17 00:00:00 2001 From: DTB Date: Wed, 7 Aug 2024 08:34:29 -0600 Subject: [PATCH] tests: bonsai/swab.mk: add example from tha man page --- tests/bonsai/swab.mk | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 tests/bonsai/swab.mk diff --git a/tests/bonsai/swab.mk b/tests/bonsai/swab.mk new file mode 100755 index 0000000..ff64c17 --- /dev/null +++ b/tests/bonsai/swab.mk @@ -0,0 +1,22 @@ +# 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. + +.PRAGMA: command_comment + +.PHONY: swab_tests +swab_tests: swab_help swab_examples + +.PHONY: swab_help +swab_help: $(BIN)/swab + ! $(BIN)/swab -h + +.PHONY: swab_examples +# These are the examples present in the man page. +swab_examples: $(BIN)/swab + printf 'hello world!\n' \ + | $(BIN)/swab \ + | xargs -I out test 'ehll oowlr!d' = out