* 'ul-refactor' of https://github.com/kerolasa/util-linux:
  ul: flip comparisons to lesser to greater order
  ul: use size_t to measure memory allocation size
  ul: improve function and variable names
  ul: rename enumerated mode symbols
  ul: remove function like putwp preprocessor define
  ul: free most allocations ncurses did during setupterm()
  ul: replace global runtime variables with a control structure
  ul: add a term capabilities tracking structure
  ul: remove function prototypes
  ul: tidy up coding style
  ul: add basic tests
This commit is contained in:
Karel Zak 2020-10-21 11:08:11 +02:00
commit 9c4762cb6b
5 changed files with 732 additions and 494 deletions

113
tests/expected/ul/basic Normal file
View File

@ -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
__

35
tests/ts/ul/basic Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
#
# Copyright (C) 2020 Sami Kerola <kerolasa@iki.fi>
#
# 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

95
tests/ts/ul/basic.input Normal file
View File

@ -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
{
|
}
~

11
tests/ts/ul/filter.input Normal file
View File

@ -0,0 +1,11 @@
backspacexy
tab
R S
SO
SI
u_n_d_e_r_line
flush afer flush
normal9dim
normal8dimunderlined
normal7reverse
eof

File diff suppressed because it is too large Load Diff