jansson: add test
Closes Homebrew/homebrew#35324. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
197e2369c4
commit
3bfe41e88f
1 changed files with 19 additions and 0 deletions
|
@ -18,4 +18,23 @@ class Jansson < Formula
|
|||
"--prefix=#{prefix}"
|
||||
system "make", "install"
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"test.c").write <<-EOS.undent
|
||||
#include <jansson.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
json_t *json;
|
||||
json_error_t error;
|
||||
json = json_loads("\\"foo\\"", JSON_DECODE_ANY, &error);
|
||||
assert(json && json_is_string(json));
|
||||
json_decref(json);
|
||||
return 0;
|
||||
}
|
||||
EOS
|
||||
system ENV.cc, "test.c", "-ljansson", "-o", "test"
|
||||
system "./test"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue