[tests] add test for realpath()

This commit is contained in:
Timothy Stack 2021-01-31 14:41:24 -08:00
parent 47fb48eaf3
commit 5c02766485
2 changed files with 15 additions and 0 deletions

View File

@ -111,6 +111,10 @@ check_output_ws() {
test_num=`expr ${test_num} \+ 1`
}
test_filename() {
echo ${test_file_base}_${test_num}.tmp
}
test_err_filename() {
echo ${test_file_base}_${test_num}.err
}

View File

@ -15,6 +15,17 @@ Row 0:
Column readlink('sql_fs_readlink_test.lnk'): sql_fs_readlink_test
EOF
ln -sf drive_sql sql_fs_realpath_test.lnk
run_test ./drive_sql "select realpath('sql_fs_realpath_test.lnk')"
rm sql_fs_realpath_test.lnk
sed -e "s|${builddir}|<build_dir>|g" `test_filename` > test_realpath.out
mv test_realpath.out `test_filename`
check_output "realpath() does not work?" <<EOF
Row 0:
Column realpath('sql_fs_realpath_test.lnk'): <build_dir>/drive_sql
EOF
run_test ./drive_sql "select basename('')"
check_output "basename('') is not '.'" <<EOF