From b1881a3e4ea4ff4b7fa473e589f5f57f3ca5b25d Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Sat, 3 Jan 2015 16:19:12 +0800 Subject: readline: add test Closes #35495. Signed-off-by: Mike McQuaid --- Library/Formula/readline.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Library/Formula') 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 + #include + #include + + 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 -- cgit v1.2.3