logo

9utils

Collection of utilities inspired by Plan9
commit: 48645fdeb5a23f92c56a24bac51d2c4c10ffc729
parent 87ace4aa7e37ce15fbf0ff860c88a8c0442dc2a0
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri,  1 Sep 2023 02:18:34 +0200

Add testsuite

Diffstat:

MMakefile6++++++
Atest-cmd/unicode.t20++++++++++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -3,6 +3,8 @@ # SPDX-License-Identifier: MPL-2.0 HARE ?= hare +CRAM ?= cram + PREFIX ?= /usr/local BINDIR ?= $(PREFIX)/bin/ MANDIR ?= $(PREFIX)/share/man/ @@ -27,6 +29,10 @@ lint: mandoc -T lint -W warning ${MANS} reuse lint +.PHONY: check +check: + $(CRAM) test-cmd/*.t + .PHONY: install install: all mkdir -p ${DESTDIR}/${BINDIR} diff --git a/test-cmd/unicode.t b/test-cmd/unicode.t @@ -0,0 +1,20 @@ +#!/usr/bin/env cram +# SPDX-FileCopyrightText: 2023 Haelwenn (lanodan) Monnier <contact+9utils@hacktivis.me> +# SPDX-License-Identifier: MPL-2.0 + + $ cd $TESTDIR/.. + + $ ./cmd/unicode 41 42 + A + B + + $ ./cmd/unicode -t 42 41 0a + BA + + $ ./cmd/unicode 30-50 + 0 0030 1 0031 2 0032 3 0033 4 0034 5 0035 6 0036 7 0037 8 0038 9 0039 : 003a ; 003b < 003c = 003d > 003e ? 003f @ 0040 A 0041 B 0042 C 0043 D 0044 E 0045 F 0046 G 0047 H 0048 I 0049 J 004a K 004b L 004c M 004d N 004e O 004f P 0050 + + $ ./cmd/unicode -n foo + 0066 + 006f + 006f