diff options
Diffstat (limited to 'cmd/lulu/testchecks/cost')
| -rw-r--r-- | cmd/lulu/testchecks/cost | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/lulu/testchecks/cost b/cmd/lulu/testchecks/cost index 479bdf4..488d6f4 100644 --- a/cmd/lulu/testchecks/cost +++ b/cmd/lulu/testchecks/cost @@ -1,11 +1,10 @@ -money='[0-9]+(\.[0-9]+)? [A-Z]{3}' -for field in "item 0" "item 1" "shipping" "fulfillment" "discount" "tax" "total" +for field in "item-0" "item-1" "shipping" "fulfillment" "discount" "tax" "total" do re="$(printf '^%s: +%s *$' "${field}" "${money}")" echo "$re" grep -E "$re" $1 done -grep -E -v '^item [^01]' $1 +grep -E -v '^item-[^01]' $1 awk ' # Ensure sum of fields equals total. !/^total/ { wantTotal += $(NF-1) } |