From bb018e8de14ace164f2d86c1341b7d048fdebaa5 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Sun, 28 Dec 2014 19:46:00 +0800 Subject: boost: add test Closes #35303. Signed-off-by: Mike McQuaid --- Library/Formula/boost.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Library/Formula/boost.rb b/Library/Formula/boost.rb index be97d08fe..2601d4ff6 100644 --- a/Library/Formula/boost.rb +++ b/Library/Formula/boost.rb @@ -140,4 +140,28 @@ class Boost < Formula s end + + test do + (testpath/"test.cpp").write <<-EOS.undent + #include + #include + #include + #include + using namespace boost::algorithm; + using namespace std; + + int main() + { + string str("a,b"); + vector strVec; + split(strVec, str, is_any_of(",")); + assert(strVec.size()==2); + assert(strVec[0]=="a"); + assert(strVec[1]=="b"); + return 0; + } + EOS + system ENV.cxx, "test.cpp", "-std=c++1y", "-lboost_system", "-o", "test" + system "./test" + end end -- cgit v1.2.3