diff options
| author | Xu Cheng | 2014-12-28 19:46:00 +0800 |
|---|---|---|
| committer | Mike McQuaid | 2014-12-28 12:40:00 +0000 |
| commit | bb018e8de14ace164f2d86c1341b7d048fdebaa5 (patch) | |
| tree | fcbb8026260e698e83f22b8bc5615cdee52d7491 /Library | |
| parent | dc970c0c61a2a6ee26c04b675c6a96db85d672dd (diff) | |
| download | homebrew-bb018e8de14ace164f2d86c1341b7d048fdebaa5.tar.bz2 | |
boost: add test
Closes #35303.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/boost.rb | 24 |
1 files changed, 24 insertions, 0 deletions
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 <boost/algorithm/string.hpp> + #include <string> + #include <vector> + #include <assert.h> + using namespace boost::algorithm; + using namespace std; + + int main() + { + string str("a,b"); + vector<string> 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 |
