mirror of
https://github.com/tstack/lnav
synced 2024-11-08 01:10:29 +00:00
411ea1fbee
Defect Number: Reviewed By: Testing Done:
144 lines
2.8 KiB
Bash
144 lines
2.8 KiB
Bash
#! /bin/bash
|
|
|
|
run_test ./drive_sql "select basename('')"
|
|
|
|
check_output "basename('') is not '.'" <<EOF
|
|
Row 0:
|
|
Column basename(''): .
|
|
EOF
|
|
|
|
run_test ./drive_sql "select basename('/')"
|
|
|
|
check_output "basename('/') is not '/'" <<EOF
|
|
Row 0:
|
|
Column basename('/'): /
|
|
EOF
|
|
|
|
run_test ./drive_sql "select basename('//')"
|
|
|
|
check_output "basename('//') is not '/'" <<EOF
|
|
Row 0:
|
|
Column basename('//'): /
|
|
EOF
|
|
|
|
run_test ./drive_sql "select basename('/foo')"
|
|
|
|
check_output "basename('/foo') is not 'foo'" <<EOF
|
|
Row 0:
|
|
Column basename('/foo'): foo
|
|
EOF
|
|
|
|
run_test ./drive_sql "select basename('foo/bar')"
|
|
|
|
check_output "basename('foo/bar') is not 'bar'" <<EOF
|
|
Row 0:
|
|
Column basename('foo/bar'): bar
|
|
EOF
|
|
|
|
run_test ./drive_sql "select basename('/foo/')"
|
|
|
|
check_output "basename('/foo/') is not 'foo'" <<EOF
|
|
Row 0:
|
|
Column basename('/foo/'): foo
|
|
EOF
|
|
|
|
run_test ./drive_sql "select basename('/foo///')"
|
|
|
|
check_output "basename('/foo///') is not 'foo'" <<EOF
|
|
Row 0:
|
|
Column basename('/foo///'): foo
|
|
EOF
|
|
|
|
run_test ./drive_sql "select basename('foo')"
|
|
|
|
check_output "basename('foo') is not 'foo'" <<EOF
|
|
Row 0:
|
|
Column basename('foo'): foo
|
|
EOF
|
|
|
|
|
|
run_test ./drive_sql "select dirname('')"
|
|
|
|
check_output "dirname('') is not '.'" <<EOF
|
|
Row 0:
|
|
Column dirname(''): .
|
|
EOF
|
|
|
|
run_test ./drive_sql "select dirname('foo')"
|
|
|
|
check_output "dirname('foo') is not '.'" <<EOF
|
|
Row 0:
|
|
Column dirname('foo'): .
|
|
EOF
|
|
|
|
run_test ./drive_sql "select dirname('foo///')"
|
|
|
|
check_output "dirname('foo///') is not '.'" <<EOF
|
|
Row 0:
|
|
Column dirname('foo///'): .
|
|
EOF
|
|
|
|
run_test ./drive_sql "select dirname('/foo/bar')"
|
|
|
|
check_output "dirname('/foo/bar') is not '/foo'" <<EOF
|
|
Row 0:
|
|
Column dirname('/foo/bar'): /foo
|
|
EOF
|
|
|
|
run_test ./drive_sql "select dirname('/')"
|
|
|
|
check_output "dirname('/') is not '/'" <<EOF
|
|
Row 0:
|
|
Column dirname('/'): /
|
|
EOF
|
|
|
|
run_test ./drive_sql "select dirname('/foo')"
|
|
|
|
check_output "dirname('/foo') is not '/'" <<EOF
|
|
Row 0:
|
|
Column dirname('/foo'): /
|
|
EOF
|
|
|
|
run_test ./drive_sql "select dirname('/foo//')"
|
|
|
|
check_output "dirname('/foo//') is not '/'" <<EOF
|
|
Row 0:
|
|
Column dirname('/foo//'): /
|
|
EOF
|
|
|
|
run_test ./drive_sql "select dirname('foo//')"
|
|
|
|
check_output "dirname('foo//') is not '.'" <<EOF
|
|
Row 0:
|
|
Column dirname('foo//'): .
|
|
EOF
|
|
|
|
|
|
run_test ./drive_sql "select joinpath()"
|
|
|
|
check_output "joinpath() is not ''" <<EOF
|
|
Row 0:
|
|
Column joinpath(): (null)
|
|
EOF
|
|
|
|
run_test ./drive_sql "select joinpath('foo')"
|
|
|
|
check_output "joinpath('foo') is not ''" <<EOF
|
|
Row 0:
|
|
Column joinpath('foo'): foo
|
|
EOF
|
|
|
|
run_test ./drive_sql "select joinpath('foo', 'bar', 'baz')"
|
|
|
|
check_output "joinpath('foo', 'bar', 'baz') is not ''" <<EOF
|
|
Row 0:
|
|
Column joinpath('foo', 'bar', 'baz'): foo/bar/baz
|
|
EOF
|
|
|
|
run_test ./drive_sql "select joinpath('foo', 'bar', 'baz', '/root')"
|
|
|
|
check_output "joinpath('foo', 'bar', 'baz', '/root') is not ''" <<EOF
|
|
Row 0:
|
|
Column joinpath('foo', 'bar', 'baz', '/root'): /root
|
|
EOF
|