aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-01-03 16:19:12 +0800
committerMike McQuaid2015-01-03 18:40:23 +0000
commitb1881a3e4ea4ff4b7fa473e589f5f57f3ca5b25d (patch)
treecae452af3e7ae97a75c778b125c52686f47a4c77 /Library
parentcf6d8e60776c01b0d2ed43e1c177bc5e591eb5f4 (diff)
downloadhomebrew-b1881a3e4ea4ff4b7fa473e589f5f57f3ca5b25d.tar.bz2
readline: add test
Closes #35495. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/readline.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Formula/readline.rb b/Library/Formula/readline.rb
index e567decb4..0820aeb9c 100644
--- a/Library/Formula/readline.rb
+++ b/Library/Formula/readline.rb
@@ -44,4 +44,20 @@ class Readline < Formula
lib.install_symlink "libhistory.6.3.dylib" => "libhistory.6.2.dylib",
"libreadline.6.3.dylib" => "libreadline.6.2.dylib"
end
+
+ test do
+ (testpath/"test.c").write <<-EOS.undent
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <readline/readline.h>
+
+ int main()
+ {
+ printf("%s\\n", readline("test> "));
+ return 0;
+ }
+ EOS
+ system ENV.cc, "test.c", "-lreadline", "-o", "test"
+ assert_equal "Hello, World!", pipe_output("./test", "Hello, World!\n").strip
+ end
end