aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
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