#!/bin/sh # Copyright (c) 2024 DTB # Copyright (c) 2024 Emma Tebibyte # 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: npc_tests npc_tests: npc_help npc_args npc_ascii .PHONY: npc_help npc_help: $(BIN)/npc ! $(BIN)/npc -h .PHONY: npc_args # arg parsing npc_args: $(BIN)/npc -e ?" = out .PHONY: npc_ascii_uppers # ASCII 0x40 to 0x5f (uppercases) npc_ascii_uppers: awk 'BEGIN{ for (i = 64; i < 96; ++i) printf("%c", i); print }' \ | $(BIN)/npc \ | sed 's/\\/\\\\/' \ | xargs -I out test @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ = out # This test is broken and will need closer inspection along with the npc(1) # source. # .PHONY: npc_ascii_lowers # # ASCII 0x60 to 0x7f (lowercases) # npc_ascii_lowers: # awk 'BEGIN{ for (i = 96; i < 128; ++i) printf("%c", i); print }' \ # | $(BIN)/npc \ # | xargs -I out test "\`abcdefghijklmnopqrstuvwxyz{|}~^?" = out