Skip to content

Commit

Permalink
Element accessor: Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Nov 26, 2023
1 parent 20ff3ae commit fac2ace
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/grib_element.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,24 @@ set -e
grep -q "Invalid element.*Value must be between 0 and 95" $tempText


# Access a double array
input=$ECCODES_SAMPLES_PATH/sh_ml_grib2.tmpl
cat > $tempFilt <<EOF
meta elemZ element(values, -1);
print "Last value as a double = [elemZ:d]";
EOF
${tools_dir}/grib_filter $tempFilt $input

cat > $tempFilt <<EOF
meta badElem element(values, 100000);
print "[badElem:d]";
EOF
set +e
${tools_dir}/grib_filter $tempFilt $input
status=$?
set -e
[ $status -ne 0 ]


# Clean up
rm -f $tempRef $tempText $tempFilt

0 comments on commit fac2ace

Please sign in to comment.