Skip to content

Commit

Permalink
Testing: string_compare
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Oct 23, 2023
1 parent b2039a9 commit 5be62bb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/grib_filter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,20 @@ cat >$tempFilt <<EOF
print "[scaleFactorOfSecondFixedSurface:s]";
EOF
${tools_dir}/grib_filter $tempFilt $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempOut
cat $tempOut
grep "MISSING" $tempOut

# Test string_compare
cat >$tempFilt <<EOF
if (rubbish is "ppp") { print "yes"; } else { print "rubbish must fail"; }
if ("ppp" is garbage) { print "yes"; } else { print "garbage must fail"; }
EOF
${tools_dir}/grib_filter $tempFilt $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempOut 2>&1
cat $tempOut
grep "rubbish must fail" $tempOut
grep "garbage must fail" $tempOut
grep "unable to get rubbish as string" $tempOut
grep "unable to get garbage as string" $tempOut


# Clean up
rm -f $tempGrib $tempFilt $tempOut $tempRef
Expand Down

0 comments on commit 5be62bb

Please sign in to comment.