libsoup: improve test

This commit is contained in:
Tom Schoonjans 2019-03-11 16:47:24 +00:00 committed by Chongyu Zhu
parent 537ccc45fc
commit 35e40199a5
No known key found for this signature in database
GPG key ID: 1A43E3C9100B38F5

View file

@ -39,11 +39,17 @@ class Libsoup < Formula
end
test do
# if this test start failing, the problem might very well be in glib-networking instead of libsoup
(testpath/"test.c").write <<~EOS
#include <libsoup/soup.h>
int main(int argc, char *argv[]) {
guint version = soup_get_major_version();
SoupMessage *msg = soup_message_new("GET", "https://brew.sh");
SoupSession *session = soup_session_new();
soup_session_send_message(session, msg); // blocks
g_assert_true(SOUP_STATUS_IS_SUCCESSFUL(msg->status_code));
g_object_unref(msg);
g_object_unref(session);
return 0;
}
EOS