Move t -> tests
This commit is contained in:
18
tests/hello-1
Executable file
18
tests/hello-1
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Testing standard Hello
|
||||
#
|
||||
# Copyright (C) 2026 fSD
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
|
||||
. ./tests/init.sh
|
||||
|
||||
cat <<EOF >exp || framework_failure_
|
||||
tcpl: Hello, World!
|
||||
EOF
|
||||
./tcpl >out || fail=1
|
||||
compare exp out || fail=1
|
||||
|
||||
exit $fail
|
||||
26
tests/init.sh
Executable file
26
tests/init.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
ME_=$(basename $0)
|
||||
|
||||
framework_failure_() {
|
||||
exit 99
|
||||
}
|
||||
|
||||
compare() {
|
||||
f1=${1:?file1 required}
|
||||
f2=${2:?file2 required}
|
||||
|
||||
if cmp -s -- "$f1" "$f2" 2>/dev/null; then
|
||||
return 0 # identical
|
||||
fi
|
||||
|
||||
if diff -u -- "$f1" "$f2" 2>/dev/null; then
|
||||
return 0
|
||||
else
|
||||
if diff -- "$f1" "$f2" 2>/dev/null; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
18
tests/name-1
Executable file
18
tests/name-1
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Testing standard Hello
|
||||
#
|
||||
# Copyright (C) 2026 fSD
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
|
||||
. ./tests/init.sh
|
||||
|
||||
cat <<EOF >exp || framework_failure_
|
||||
tcpl: Hello, Seaman!
|
||||
EOF
|
||||
./tcpl Seaman >out || fail=1
|
||||
compare exp out || fail=1
|
||||
|
||||
exit $fail
|
||||
Reference in New Issue
Block a user