nasm: add test

Closes Homebrew/homebrew#26551.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
master
Mike Naberezny 2014-02-09 10:41:25 -08:00 committed by Mike McQuaid
parent 67d8ec6dec
commit c7718a2170
1 changed files with 14 additions and 0 deletions

View File

@ -12,4 +12,18 @@ class Nasm < Formula
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