aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike Naberezny2014-02-03 09:46:14 -0800
committerMike McQuaid2014-02-03 18:02:21 +0000
commit46ad4073e3c8ea3a00c789c4fd83453a9a5ed1cf (patch)
treed1b5f0db9122ae77a5d7fde0812ae99c7874c52d /Library
parentf9c0f5b920d6bc87d59e0a532ca941a8c160c48b (diff)
downloadhomebrew-46ad4073e3c8ea3a00c789c4fd83453a9a5ed1cf.tar.bz2
dasm: add test
Closes #26383. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/dasm.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Formula/dasm.rb b/Library/Formula/dasm.rb
index 0ddfc9141..3ea73597d 100644
--- a/Library/Formula/dasm.rb
+++ b/Library/Formula/dasm.rb
@@ -9,4 +9,17 @@ class Dasm < Formula
system "make"
prefix.install 'bin', 'doc'
end
+
+ test do
+ path = testpath/"a.asm"
+ path.write <<-EOS
+ processor 6502
+ org $c000
+ jmp $fce2
+ EOS
+
+ system bin/"dasm", path
+ code = File.open(testpath/"a.out", "rb") { |f| f.read.unpack("C*") }
+ assert_equal [0x00, 0xc0, 0x4c, 0xe2, 0xfc], code
+ end
end