Permalink
Browse files

nasm: add test

Closes Homebrew/legacy-homebrew#26551.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information...
mnaberez authored and MikeMcQuaid committed Feb 9, 2014
1 parent 67d8ec6 commit c7718a217086be7b82e4da2b2c49a270fe1c8b8e
Showing with 14 additions and 0 deletions.
  1. +14 −0 Formula/nasm.rb
View
@@ -12,4 +12,18 @@ def install
system "./configure", "--prefix=#{prefix}"
system "make install install_rdf"
end
test do
(testpath/"foo.s").write <<-EOS
mov eax, 0
mov ebx, 0
int 0x80
EOS
system "#{bin}/nasm", "foo.s"
code = File.open("foo", "rb") { |f| f.read.unpack("C*") }
expected = [0x66, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x66, 0xbb,
0x00, 0x00, 0x00, 0x00, 0xcd, 0x80]
assert_equal expected, code
end
end

0 comments on commit c7718a2

Please sign in to comment.