You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lnav/test/test_sql_json_func.sh

56 lines
1.1 KiB
Bash

#! /bin/bash
run_test ./drive_sql "select jget('4', '')"
check_output "jget root does not work" <<EOF
Row 0:
Column jget('4', ''): 4
EOF
run_test ./drive_sql "select jget('4', null)"
check_output "jget null does not work" <<EOF
Row 0:
Column jget('4', null): 4
EOF
run_test ./drive_sql "select jget('[null, true, 20, 30, 40]', '/3')"
check_error_output "" <<EOF
EOF
check_output "jget null does not work" <<EOF
Row 0:
Column jget('[null, true, 20, 30, 40]', '/3'): 30
EOF
run_test ./drive_sql "select jget('[null, true, 20, 30, 40]', '/abc')"
check_error_output "" <<EOF
EOF
check_output "jget for array does not work" <<EOF
Row 0:
Column jget('[null, true, 20, 30, 40]', '/abc'): (null)
EOF
run_test ./drive_sql "select jget('[null, true, 20, 30, 40]', '/abc', 1)"
check_error_output "" <<EOF
EOF
check_output "jget for array does not work" <<EOF
Row 0:
Column jget('[null, true, 20, 30, 40]', '/abc', 1): 1
EOF
run_test ./drive_sql "select jget('[null, true, 20, 30, 40]', '/0/foo')"
check_error_output "" <<EOF
EOF
check_output "jget for array does not work" <<EOF
Row 0:
Column jget('[null, true, 20, 30, 40]', '/0/foo'): (null)
EOF