From b4eb53e5aa22e50be439f8fa62f5f85326f2fb10 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Mon, 29 Dec 2014 08:54:45 +0800 Subject: jansson: add test Closes #35324. Signed-off-by: Jack Nagel --- Library/Formula/jansson.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Library/Formula') diff --git a/Library/Formula/jansson.rb b/Library/Formula/jansson.rb index 1db3bee06..2e27dd0c6 100644 --- a/Library/Formula/jansson.rb +++ b/Library/Formula/jansson.rb @@ -18,4 +18,23 @@ class Jansson < Formula "--prefix=#{prefix}" system "make", "install" end + + test do + (testpath/"test.c").write <<-EOS.undent + #include + #include + + 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 -- cgit v1.2.3