logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: 949e97c3fbbe22420bb9730857a42b5aa7ed9179
parent b8fade2c9be9da04735ac311e152f1264e80a714
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon,  5 Apr 2021 02:50:14 +0200

test-bin: Add test for xcd

Diffstat:

MMakefile3+++
Atest-bin/Makefile2++
Atest-bin/xcd.t136+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 141 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -2,6 +2,9 @@ all: cd bin ; $(MAKE) cd sbin ; $(MAKE) +test: all + cd test-bin ; $(MAKE) test + clean: cd bin ; $(MAKE) clean cd sbin ; $(MAKE) clean diff --git a/test-bin/Makefile b/test-bin/Makefile @@ -0,0 +1,2 @@ +test: + ./xcd.t diff --git a/test-bin/xcd.t b/test-bin/xcd.t @@ -0,0 +1,136 @@ +#!/bin/sh +# all_bytes +( +base64 -d <<EOF +AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4 +OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bx +cnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmq +q6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj +5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w== +EOF +) | ../bin/xcd > xcd.out || exit 1 + +# Original xcd.out output +( +base64 -d <<EOF +G1swbRtbNDg7MjswOzA7MG0bWzM4OzI7NjQ7NjQ7NjRtMDAwMDAwIBtbMzg7Mjs2NDs2NDs2NG0w +MCAbWzM4OzI7MTMwOzIzNjsxNm0wMSAbWz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