Testing: add test for grib_set -S option

This commit is contained in:
Shahram Najm 2022-05-16 14:26:29 +01:00
parent 203e38c1d5
commit 6a55afe429
1 changed files with 15 additions and 0 deletions

View File

@ -137,5 +137,20 @@ set -e
grep -q "String cannot be converted to a double" $temp
# Strict option
# ---------------
# There is only one field in this file with shortName=2t
input=${data_dir}/tigge_cf_ecmwf.grib2
# This copies all messages to the output changing one of them
${tools_dir}/grib_set -w shortName=2t -s offsetValuesBy=0.5 $input $outfile
count=`${tools_dir}/grib_count $outfile`
[ $count -eq 43 ]
# Now we copy only what was changed
${tools_dir}/grib_set -w shortName=2t -S -s offsetValuesBy=0.5 $input $outfile
count=`${tools_dir}/grib_count $outfile`
[ $count -eq 1 ]
grib_check_key_equals $outfile shortName '2t'
# Clean up
rm -f $outfile $temp