mirror of https://github.com/ecmwf/eccodes.git
Testing: substring invalid cases
This commit is contained in:
parent
e8d0eaa3cd
commit
5c9f0a04b8
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue