aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/jansson.rb19
1 files changed, 19 insertions, 0 deletions
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 <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