From aa439c603595735c7f57c3518f0943c6078b4792 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 1 Aug 2020 13:20:30 +0100 Subject: [PATCH] ul: add basic tests Signed-off-by: Sami Kerola --- tests/expected/ul/basic | 113 +++++++++++++++++++++++++++++++++++++++ tests/ts/ul/basic | 35 ++++++++++++ tests/ts/ul/basic.input | 95 ++++++++++++++++++++++++++++++++ tests/ts/ul/filter.input | 11 ++++ 4 files changed, 254 insertions(+) create mode 100644 tests/expected/ul/basic create mode 100755 tests/ts/ul/basic create mode 100644 tests/ts/ul/basic.input create mode 100644 tests/ts/ul/filter.input diff --git a/tests/expected/ul/basic b/tests/expected/ul/basic new file mode 100644 index 0000000000..4a6cdd6750 --- /dev/null +++ b/tests/expected/ul/basic @@ -0,0 +1,113 @@ +printable characters + +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +filter input +backspacex + tab +R +SO +SI(B +underline +flush + afer flush +normaldim(B +normaldimunderlined +normal +reverse +eof +indicated +ul +__ diff --git a/tests/ts/ul/basic b/tests/ts/ul/basic new file mode 100755 index 0000000000..bc0c1168d4 --- /dev/null +++ b/tests/ts/ul/basic @@ -0,0 +1,35 @@ +#!/bin/bash + +# +# Copyright (C) 2020 Sami Kerola +# +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +TS_TOPDIR="${0%/*}/../.." +TS_DESC="basic tests" + +. $TS_TOPDIR/functions.sh +ts_init "$*" + +ts_check_test_command "$TS_CMD_UL" + +ts_log "printable characters" +$TS_CMD_UL < $TS_SELF/basic.input >> $TS_OUTPUT 2>> $TS_ERRLOG + +ts_log "filter input" +$TS_CMD_UL $TS_SELF/filter.input >> $TS_OUTPUT 2>> $TS_ERRLOG + +ts_log "indicated" +printf "u\b_l\b_\n" | ul --indicated >> $TS_OUTPUT 2>> $TS_ERRLOG + +ts_finalize diff --git a/tests/ts/ul/basic.input b/tests/ts/ul/basic.input new file mode 100644 index 0000000000..3bc7fbc7be --- /dev/null +++ b/tests/ts/ul/basic.input @@ -0,0 +1,95 @@ + +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ diff --git a/tests/ts/ul/filter.input b/tests/ts/ul/filter.input new file mode 100644 index 0000000000..c9005954f1 --- /dev/null +++ b/tests/ts/ul/filter.input @@ -0,0 +1,11 @@ +backspacexy + tab +R S +SO +SI +u_n_d_e_r_line +flush afer flush +normal9dim +normal8dimunderlined +normal7reverse +eof -- 2.47.2