nasm: add test
Closes Homebrew/homebrew#26551. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>master
parent
67d8ec6dec
commit
c7718a2170
|
@ -12,4 +12,18 @@ class Nasm < Formula
|
||||||
system "./configure", "--prefix=#{prefix}"
|
system "./configure", "--prefix=#{prefix}"
|
||||||
system "make install install_rdf"
|
system "make install install_rdf"
|
||||||
end
|
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
|
end
|
||||||
|
|
Loading…
Reference in New Issue