Make semaphore.h a non-portable header
[folly.git] / folly / test / RangeTest.cpp
index 791df2a051887cdadd8dcfe436126f90651e5654..8a2b2762def14124b57ea0c7b927d48400d3f11d 100644 (file)
@@ -418,6 +418,13 @@ TEST(StringPiece, Suffix) {
   }
 }
 
+TEST(StringPiece, Equals) {
+  StringPiece a("hello");
+
+  EXPECT_TRUE(a.equals("HELLO", AsciiCaseInsensitive()));
+  EXPECT_FALSE(a.equals("HELLOX", AsciiCaseInsensitive()));
+}
+
 TEST(StringPiece, PrefixEmpty) {
   StringPiece a;
   EXPECT_TRUE(a.startsWith(""));
@@ -1112,14 +1119,10 @@ TEST(RangeFunc, Array) {
   testRangeFunc(x, 3);
 }
 
-// MSVC doesn't like it when you try to std::move C arrays:
-// https://developercommunity.visualstudio.com/content/problem/2441/
-#ifndef _MSC_VER
 TEST(RangeFunc, CArray) {
   int x[] {1, 2, 3, 4};
   testRangeFunc(x, 4);
 }
-#endif
 
 TEST(RangeFunc, ConstexprCArray) {
   static constexpr const int numArray[4] = {3, 17, 1, 9};
@@ -1133,15 +1136,8 @@ TEST(RangeFunc, ConstexprStdArray) {
   static constexpr const std::array<int, 4> numArray = {{3, 17, 1, 9}};
   constexpr const auto numArrayRange = range(numArray);
   EXPECT_EQ(17, numArrayRange[1]);
-  // MSVC 2017 RC and earlier have an issue that causes the beginning and
-  // end of numArrayRange to point to different copies of numArray, causing
-  // this attempt to calculate the size to error at compile time because
-  // they don't point to parts of the same array :(
-  // https://developercommunity.visualstudio.com/content/problem/3216/
-#if !defined(_MSC_VER) || _MSC_VER > 191024629
   constexpr const auto numArrayRangeSize = numArrayRange.size();
   EXPECT_EQ(4, numArrayRangeSize);
-#endif
 }
 
 TEST(RangeFunc, ConstexprStdArrayZero) {