aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMike Naberezny2014-02-06 12:05:53 -0800
committerMike McQuaid2014-02-06 20:09:14 +0000
commitff52a119ae9f8aaf01d7bbf8d3b164501638afd7 (patch)
treeda5dffb6c2aa89e5ccb7072d6a72d28692998b36 /Library/Formula
parent320194ec695b339ee2c0c3dd1d545365c8dc146c (diff)
downloadhomebrew-ff52a119ae9f8aaf01d7bbf8d3b164501638afd7.tar.bz2
bgrep: add test
Closes #26482. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/bgrep.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Formula/bgrep.rb b/Library/Formula/bgrep.rb
index f81477247..19fca5142 100644
--- a/Library/Formula/bgrep.rb
+++ b/Library/Formula/bgrep.rb
@@ -9,4 +9,15 @@ class Bgrep < Formula
system "#{ENV.cc} #{ENV.cflags} -o bgrep bgrep.c"
bin.install "bgrep"
end
+
+ test do
+ path = testpath/"hi.prg"
+ code = [0x00, 0xc0, 0xa9, 0x48, 0x20, 0xd2, 0xff,
+ 0xa9, 0x49, 0x20, 0xd2, 0xff, 0x60].pack("C*")
+ path.open("wb") { |f| f.write code }
+
+ lines = `#{bin}/bgrep 20d2ff #{path}`.strip.split("\n")
+ assert_equal ["#{path}: 00000004", "#{path}: 00000009"], lines
+ assert_equal 0, $?.exitstatus
+ end
end