aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Formula/boost.rb24
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