mirror of
https://github.com/tstack/lnav.git
synced 2024-08-17 00:40:30 +03:00
[tests] fix some test issues
This commit is contained in:
parent
f2968a7032
commit
182da31213
@ -88,9 +88,9 @@ run_test() {
|
||||
|
||||
run_cap_test() {
|
||||
LAST_CAP_TEST=("test: $@")
|
||||
local full_cmd=$(echo "${LAST_CAP_TEST[@]}" | sed -e "s;${test_dir};{test_dir};g")
|
||||
export test_hash=$(echo "${full_cmd}" | shasum | cut -f 1 -d ' ')
|
||||
echo "${full_cmd}" > ${test_file_base}_${test_hash}.cmd
|
||||
local full_cmd=$(printf "%s" "${LAST_CAP_TEST[@]}" | sed -e "s;${test_dir};{test_dir};g")
|
||||
export test_hash=$(printf "%s" "${full_cmd}" | shasum | cut -f 1 -d ' ')
|
||||
printf "%s" "${full_cmd}" > ${test_file_base}_${test_hash}.cmd
|
||||
"$@" > ${test_file_base}_${test_hash}.out 2> ${test_file_base}_${test_hash}.err
|
||||
|
||||
sed -ibak \
|
||||
@ -112,9 +112,11 @@ run_cap_test() {
|
||||
if test $? -ne 0; then
|
||||
echo OUT: "${full_cmd}"
|
||||
cat ${test_file_base}_${test_hash}.diff
|
||||
echo "FAIL! EXPECTED OUT DIFF"
|
||||
export has_errors="yes"
|
||||
fi
|
||||
else
|
||||
echo "FAIL! EXPECTED OUT MISSING"
|
||||
export has_errors="yes"
|
||||
fi
|
||||
|
||||
@ -134,9 +136,11 @@ run_cap_test() {
|
||||
if test $? -ne 0; then
|
||||
echo ERR: "${full_cmd}"
|
||||
cat ${test_file_base}_${test_hash}.err.diff
|
||||
echo "FAIL! EXPECTED ERR DIFF"
|
||||
export has_errors="yes"
|
||||
fi
|
||||
else
|
||||
echo "FAIL! EXPECTED ERR MISSING"
|
||||
export has_errors="yes"
|
||||
fi
|
||||
}
|
||||
|
@ -442,6 +442,8 @@ EXPECTED_FILES = \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_8f4f0ed74c4dc6b821e02a44552b694614cd9353.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_9093805121dac221f9fb5ff0f3f5f93f1532a77e.err \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_9093805121dac221f9fb5ff0f3f5f93f1532a77e.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_a4d84a0082a7df34c95c2e6e070bbf6effaa5594.err \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_a4d84a0082a7df34c95c2e6e070bbf6effaa5594.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_a65d2fb2f841578619528ca10168ca4d650218e9.err \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_a65d2fb2f841578619528ca10168ca4d650218e9.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_ac7ecdda0fcc4279a4694291edaa2f1411f5262e.err \
|
||||
@ -452,6 +454,8 @@ EXPECTED_FILES = \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_b2aafbcaa7befe426d3f9df71c24f16fdc9d2856.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_bf5b4763d86fe5331d821f74c6784ec9555df343.err \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_bf5b4763d86fe5331d821f74c6784ec9555df343.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_bfb7088916412360f77683009058b0747784630a.err \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_bfb7088916412360f77683009058b0747784630a.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_bfe8b09e23389af0ef14359b66d68228d0285185.err \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_bfe8b09e23389af0ef14359b66d68228d0285185.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_c9e2f41431bef879364dc37a472ab01f64d89f89.err \
|
||||
@ -466,8 +470,12 @@ EXPECTED_FILES = \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_d4e805ff08d4ccf62865dbf8db8d526f7ce02f37.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_d8d4cde8bbc98175069be579ff5634de43880b8c.err \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_d8d4cde8bbc98175069be579ff5634de43880b8c.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_d8e9451f2c708142b100508056badb13e8128a76.err \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_d8e9451f2c708142b100508056badb13e8128a76.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_e68167bf5edc7a7b1defd06bdfb694ffa8b00df2.err \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_e68167bf5edc7a7b1defd06bdfb694ffa8b00df2.out \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_ec939e82da809965c61f1c00f68d7afaa4a88382.err \
|
||||
$(srcdir)/%reldir%/test_sql_str_func.sh_ec939e82da809965c61f1c00f68d7afaa4a88382.out \
|
||||
$(srcdir)/%reldir%/test_sql_time_func.sh_028e99419eb1ac80b03b36148ef1d4ae1c38c44c.err \
|
||||
$(srcdir)/%reldir%/test_sql_time_func.sh_028e99419eb1ac80b03b36148ef1d4ae1c38c44c.out \
|
||||
$(srcdir)/%reldir%/test_sql_time_func.sh_123c85ff1178743f5cb78efeaf98b637bcbe55ff.err \
|
||||
|
@ -34,13 +34,19 @@ run_cap_test ./drive_sql "select regexp('[e-z]+', 'ea')"
|
||||
|
||||
run_cap_test ./drive_sql "select regexp_replace('test 1 2 3', '\\d+', 'N')"
|
||||
|
||||
run_cap_test ./drive_sql "select regexp_replace('test 1 2 3', '\\s+', '{\\0}') as repl"
|
||||
run_cap_test env TEST_COMMENT=regexp_replace_with_bs1 ./drive_sql <<'EOF'
|
||||
select regexp_replace('test 1 2 3', '\s+', '{\0}') as repl
|
||||
EOF
|
||||
|
||||
run_cap_test ./drive_sql "select regexp_replace('test 1 2 3', '\\w*', '{\\0}') as repl"
|
||||
run_cap_test env TEST_COMMENT=regexp_replace_with_bs2 ./drive_sql <<'EOF'
|
||||
select regexp_replace('test 1 2 3', '\w*', '{\0}') as repl
|
||||
EOF
|
||||
|
||||
run_cap_test ./drive_sql "select regexp_replace('123 abc', '(\w*)', '<\3>') as repl"
|
||||
|
||||
run_cap_test ./drive_sql "select regexp_replace('123 abc', '(\w*)', '<\\\\>') as repl"
|
||||
run_cap_test env TEST_COMMENT=regexp_replace_with_bs3 ./drive_sql <<'EOF'
|
||||
select regexp_replace('123 abc', '(\w*)', '<\\>') as repl
|
||||
EOF
|
||||
|
||||
run_cap_test ./drive_sql "select regexp_replace('abc: def', '(\w*):\s*(.*)', '\1=\2') as repl"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user