sbase/tests/0025-ed.sh
Roberto E. Vargas Caballero c02bf1a70d tests: USE $EXEC and fix ed path
Using an EXEC variable for every test make easy to run tools to
debug issues like for example using EXEC=valgrind ./0025-ed.sh.
Some tests for ed had a wrong path to the ed binary and they
were not testing the actual ed but the system one.
2026-01-13 12:11:16 +01:00

30 lines
380 B
Bash
Executable File

#!/bin/sh
tmp=tmp.$$
trap 'rm -f $tmp' EXIT
trap 'exit $?' HUP INT TERM
cat <<'EOF' > $tmp
LLL\
static int xflag = 0;
static int gflag = 0;
extern long arflag = 0;
EOF
$EXEC ../ed -s /dev/null <<'EOF' | diff -u $tmp -
i
LLL
.
s/$/\\
g/^L/ a\
static int xflag = 0;\
static int gflag = 0;\
static int arflag = 0;
v! .flag!s/^static/extern/\
s# int # long #
g_^[^a-z]_d
,p
Q
EOF