Testing: substring invalid cases

This commit is contained in:
Shahram Najm 2023-08-21 16:23:58 +01:00
parent e8d0eaa3cd
commit 5c9f0a04b8
1 changed files with 15 additions and 1 deletions

View File

@ -34,5 +34,19 @@ EOF
${tools_dir}/grib_filter - $sample 2>$temp <<EOF ${tools_dir}/grib_filter - $sample 2>$temp <<EOF
transient xx = substr("abc", -1, -1); transient xx = substr("abc", -1, -1);
EOF EOF
grep -q "Invalid substring" $temp cat $temp
grep -q "Invalid substring.*start=" $temp
${tools_dir}/grib_filter - $sample 2>$temp <<EOF
transient xx = substr("abc", 0, 0);
EOF
cat $temp
grep -q "Invalid substring.*length must be > 0" $temp
${tools_dir}/grib_filter - $sample 2>$temp <<EOF
transient xx = substr("abc", 0, 8);
EOF
cat $temp
grep -q "Invalid substring.*start.*length" $temp
# Clean up
rm -f $temp rm -f $temp