Skip to content

Commit

Permalink
mawk: fix and improve test
Browse files Browse the repository at this point in the history
the test was comparing the local "version" variable to itself
now get version from the mawk executable and use mawk to parse it
  • Loading branch information
ploxiln authored and nijikon committed Dec 7, 2016
1 parent 16f0e6a commit a2d5e3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Formula/mawk.rb
Expand Up @@ -23,7 +23,8 @@ def install
end

test do
version = shell_output("#{bin}/mawk '/version/ { print $2 }' #{prefix}/README")
assert_equal version, version.to_s
mawk_expr = '/^mawk / {printf("%s-%s", $2, $3)}'
ver_out = shell_output("#{bin}/mawk -W version 2>&1 | #{bin}/mawk '#{mawk_expr}'")
assert_equal version.to_s, ver_out
end
end

0 comments on commit a2d5e3e

Please sign in to comment.