diff --git a/test/raw.cpp b/test/raw.cpp
index 5e48419..5248b9f 100644
--- a/test/raw.cpp
+++ b/test/raw.cpp
@@ -1,10 +1,7 @@
 #include <array>
-#if __has_include(<catch2/catch.hpp>)
-#include <catch2/catch.hpp>
-#else
-#include <catch2/catch_test_macros.hpp>
-#endif
 #include <endian.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
 #include <span>
 #include <stdexcept>
 #include <stdplus/raw.hpp>
@@ -18,36 +15,36 @@
 namespace
 {
 
-TEST_CASE("Equal", "[Equal]")
+TEST(Equal, Equal)
 {
     int a = 4;
     unsigned b = 4;
-    CHECK(equal(a, b));
+    EXPECT_TRUE(equal(a, b));
     b = 5;
-    CHECK(!equal(a, b));
+    EXPECT_FALSE(equal(a, b));
 }
 
-TEST_CASE("Copy From Empty", "[CopyFrom]")
+TEST(CopyFrom, Empty)
 {
     const std::string_view cs;
-    CHECK_THROWS_AS(copyFrom<int>(cs), std::runtime_error);
+    EXPECT_THROW(copyFrom<int>(cs), std::runtime_error);
     std::string_view s;
-    CHECK_THROWS_AS(copyFrom<int>(s), std::runtime_error);
+    EXPECT_THROW(copyFrom<int>(s), std::runtime_error);
 }
 
-TEST_CASE("Copy From Basic", "[CopyFrom]")
+TEST(CopyFrom, Basic)
 {
     int a = 4;
     const std::string_view s(reinterpret_cast<char*>(&a), sizeof(a));
-    CHECK(a == copyFrom<int>(s));
+    EXPECT_EQ(a, copyFrom<int>(s));
 }
 
-TEST_CASE("Copy From Partial", "[CopyFrom]")
+TEST(CopyFrom, Partial)
 {
     const std::vector<char> s = {'a', 'b', 'c'};
-    CHECK('a' == copyFrom<char>(s));
+    EXPECT_EQ('a', copyFrom<char>(s));
     const char s2[] = "def";
-    CHECK('d' == copyFrom<char>(s2));
+    EXPECT_EQ('d', copyFrom<char>(s2));
 }
 
 struct Int
@@ -60,176 +57,167 @@
     }
 };
 
-TEST_CASE("Ref From Empty", "[RefFrom]")
+TEST(RefFrom, Empty)
 {
     const std::string_view cs;
-    CHECK_THROWS_AS(refFrom<Int>(cs), std::runtime_error);
+    EXPECT_THROW(refFrom<Int>(cs), std::runtime_error);
     std::string_view s;
-    CHECK_THROWS_AS(refFrom<Int>(s), std::runtime_error);
+    EXPECT_THROW(refFrom<Int>(s), std::runtime_error);
 }
 
-TEST_CASE("Ref From Basic", "[RefFrom]")
+TEST(RefFrom, Basic)
 {
     Int a = {4, 0, 0, 4};
     const std::string_view s(reinterpret_cast<char*>(&a), sizeof(a));
-    CHECK(a == refFrom<Int>(s));
+    EXPECT_EQ(a, refFrom<Int>(s));
 }
 
-TEST_CASE("Ref From Partial", "[RefFrom]")
+TEST(RefFrom, Partial)
 {
     const std::vector<char> s = {'a', 'b', 'c'};
-    CHECK('a' == refFrom<char>(s));
+    EXPECT_EQ('a', refFrom<char>(s));
     const char s2[] = "def";
-    CHECK('d' == refFrom<char>(s2));
+    EXPECT_EQ('d', refFrom<char>(s2));
 }
 
-TEST_CASE("Extract Too Small", "[Extract]")
+TEST(Extract, TooSmall)
 {
     std::string_view s("a");
-    CHECK_THROWS_AS(extract<int>(s), std::runtime_error);
-    CHECK(1 == s.size());
+    EXPECT_THROW(extract<int>(s), std::runtime_error);
+    EXPECT_EQ("a", s);
 }
 
-TEST_CASE("Extract Basic", "[Extract]")
+TEST(Extract, Basic)
 {
     int a = 4;
     std::string_view s(reinterpret_cast<char*>(&a), sizeof(a));
-    CHECK(a == extract<int>(s));
-    CHECK(s.empty());
+    EXPECT_EQ(a, extract<int>(s));
+    EXPECT_TRUE(s.empty());
 }
 
-TEST_CASE("Extract Partial", "[Extract]")
+TEST(Extract, Partial)
 {
     std::string_view s("abc");
-    CHECK('a' == extract<char>(s));
-    CHECK(2 == s.size());
+    EXPECT_EQ('a', extract<char>(s));
+    EXPECT_EQ("bc", s);
 }
 
-TEST_CASE("Extract Ref Too Small", "[ExtractRef]")
+TEST(ExtractRef, TooSmall)
 {
     std::string_view s("a");
-    CHECK_THROWS_AS(extractRef<Int>(s), std::runtime_error);
-    CHECK(1 == s.size());
+    EXPECT_THROW(extractRef<Int>(s), std::runtime_error);
+    EXPECT_EQ("a", s);
 }
 
-TEST_CASE("Extract Ref Basic", "[ExtractRef]")
+TEST(ExtractRef, Basic)
 {
     Int a = {4, 0, 0, 4};
     std::string_view s(reinterpret_cast<char*>(&a), sizeof(a));
-    CHECK(a == extractRef<Int>(s));
-    CHECK(s.empty());
+    EXPECT_EQ(a, extractRef<Int>(s));
+    EXPECT_TRUE(s.empty());
 }
 
-TEST_CASE("Extract Ref Partial", "[ExtractRef]")
+TEST(ExtractRef, Partial)
 {
     std::string_view s("abc");
-    CHECK('a' == extractRef<char>(s));
-    CHECK(2 == s.size());
+    EXPECT_EQ('a', extractRef<char>(s));
+    EXPECT_EQ("bc", s);
 }
 
-TEST_CASE("As View Byte", "[AsView]")
+TEST(AsView, Byte)
 {
     int32_t a = 4;
     auto s = asView<uint8_t>(a);
-    CHECK(a == copyFrom<int>(s));
+    EXPECT_EQ(a, copyFrom<int>(s));
 }
 
-TEST_CASE("As View Int", "[AsView]")
+TEST(AsView, Int)
 {
     int32_t a = 4;
     auto s = asView<char16_t>(a);
-    CHECK(a == copyFrom<int>(s));
+    EXPECT_EQ(a, copyFrom<int>(s));
 }
 
-TEST_CASE("As View Arr", "[AsView]")
+using testing::ElementsAre;
+using testing::ElementsAreArray;
+
+TEST(AsView, Array)
 {
     std::vector<uint32_t> arr = {htole32(1), htole32(2)};
     auto s = asView<char16_t>(arr);
-    REQUIRE(4 == s.size());
-    CHECK(htole16(1) == s[0]);
-    CHECK(htole16(0) == s[1]);
-    CHECK(htole16(2) == s[2]);
-    CHECK(htole16(0) == s[3]);
+    EXPECT_THAT(s, ElementsAre(htole16(1), htole16(0), htole16(2), htole16(0)));
 }
 
-TEST_CASE("As View View", "[AsView]")
+TEST(AsView, StringView)
 {
     std::string_view sv = "ab";
     auto s = asView<uint8_t>(sv);
-    REQUIRE(s.size() == 2);
-    CHECK(s[0] == sv[0]);
-    CHECK(s[1] == sv[1]);
+    EXPECT_THAT(s, ElementsAreArray(sv));
 }
 
-TEST_CASE("Span Extract TooSmall", "[Extract]")
+TEST(SpanExtract, TooSmall)
 {
     const std::vector<char> v = {'c'};
     std::span<const char> s = v;
-    CHECK_THROWS_AS(extract<int>(s), std::runtime_error);
-    CHECK(1 == s.size());
+    EXPECT_THROW(extract<int>(s), std::runtime_error);
+    EXPECT_THAT(s, ElementsAreArray(v));
 }
 
-TEST_CASE("Span Extract Basic", "[Extract]")
+TEST(SpanExtract, Basic)
 {
     const std::vector<int> v = {4};
     std::span<const int> s = v;
-    CHECK(v[0] == extract<int>(s));
-    CHECK(s.empty());
+    EXPECT_EQ(v[0], extract<int>(s));
+    EXPECT_TRUE(s.empty());
 }
 
-TEST_CASE("Span Extract Larger", "[Extract]")
+TEST(SpanExtract, Larger)
 {
     const std::vector<int> v{3, 4, 5};
     std::span<const int> s = v;
-    CHECK(v[0] == extract<int>(s));
-    CHECK(v.size() - 1 == s.size());
+    EXPECT_EQ(v[0], extract<int>(s));
+    EXPECT_THAT(s, ElementsAre(v[1], v[2]));
 }
 
-TEST_CASE("Span Extract Ref TooSmall", "[ExtractRef]")
+TEST(SpanExtractRef, TooSmall)
 {
     const std::vector<char> v = {'c'};
     std::span<const char> s = v;
-    CHECK_THROWS_AS(extractRef<Int>(s), std::runtime_error);
-    CHECK(1 == s.size());
+    EXPECT_THROW(extractRef<Int>(s), std::runtime_error);
+    EXPECT_THAT(s, ElementsAreArray(v));
 }
 
-TEST_CASE("Span Extract Ref Basic", "[ExtractRef]")
+TEST(SpanExtractRef, Basic)
 {
     const std::vector<Int> v = {{4, 0, 0, 4}};
     std::span<const Int> s = v;
-    CHECK(v[0] == extractRef<Int>(s));
-    CHECK(s.empty());
+    EXPECT_EQ(v[0], extractRef<Int>(s));
+    EXPECT_TRUE(s.empty());
 }
 
-TEST_CASE("Span Extract Ref Larger", "[ExtractRef]")
+TEST(SpanExtractRef, Larger)
 {
     const std::vector<Int> v{{3}, {4}, {5}};
     std::span<const Int> s = v;
-    CHECK(v[0] == extractRef<Int>(s));
-    CHECK(v.size() - 1 == s.size());
+    EXPECT_EQ(v[0], extractRef<Int>(s));
+    EXPECT_THAT(s, ElementsAre(v[1], v[2]));
 }
 
-TEST_CASE("As Span const", "[AsSpan]")
+TEST(AsSpan, ConstInt)
 {
     const uint64_t data = htole64(0xffff0000);
     auto s = asSpan<uint32_t>(data);
-    CHECK(s.size() == 2);
-    CHECK(s[0] == htole32(0xffff0000));
-    CHECK(s[1] == htole32(0x00000000));
+    EXPECT_THAT(s, ElementsAre(htole32(0xffff0000), htole32(0x00000000)));
 }
 
-TEST_CASE("As Span Arr const", "[AsSpan]")
+TEST(AsSpan, ConstArray)
 {
     const std::vector<uint32_t> arr = {htole32(1), htole32(2)};
     auto s = asSpan<uint16_t>(arr);
-    REQUIRE(4 == s.size());
-    CHECK(htole16(1) == s[0]);
-    CHECK(htole16(0) == s[1]);
-    CHECK(htole16(2) == s[2]);
-    CHECK(htole16(0) == s[3]);
+    EXPECT_THAT(s, ElementsAre(htole16(1), htole16(0), htole16(2), htole16(0)));
 }
 
-TEST_CASE("As Span", "[AsSpan]")
+TEST(AsSpan, Int)
 {
     struct
     {
@@ -240,38 +228,29 @@
         }
     } data = {htole64(0xffff0000)};
     auto s = asSpan<uint16_t>(data);
-    CHECK(s.size() == 4);
+    EXPECT_THAT(s, ElementsAre(htole16(0x0000), htole16(0xffff),
+                               htole16(0x0000), htole16(0x0000)));
     s[2] = 0xfefe;
-    CHECK(s[0] == htole16(0x0000));
-    CHECK(s[1] == htole16(0xffff));
-    CHECK(s[2] == htole16(0xfefe));
-    CHECK(s[3] == htole16(0x0000));
+    EXPECT_THAT(s, ElementsAre(htole16(0x0000), htole16(0xffff),
+                               htole16(0xfefe), htole16(0x0000)));
 }
 
-TEST_CASE("As Span Arr", "[AsSpan]")
+TEST(AsSpan, Array)
 {
     std::vector<uint32_t> arr = {htole32(1), htole32(2)};
     auto s = asSpan<uint16_t>(arr);
-    REQUIRE(4 == s.size());
-    CHECK(htole16(1) == s[0]);
-    CHECK(htole16(0) == s[1]);
-    CHECK(htole16(2) == s[2]);
-    CHECK(htole16(0) == s[3]);
+    EXPECT_THAT(s, ElementsAre(htole16(1), htole16(0), htole16(2), htole16(0)));
 }
 
-TEST_CASE("As Span Span", "[AsSpan]")
+TEST(AsSpan, Span)
 {
     std::array<char, 2> arr = {'a', 'b'};
     auto sp1 = std::span<const char>(arr);
     auto s1 = asSpan<uint8_t>(sp1);
-    REQUIRE(s1.size() == 2);
-    CHECK(s1[0] == arr[0]);
-    CHECK(s1[1] == arr[1]);
+    EXPECT_THAT(s1, ElementsAreArray(arr));
     auto sp2 = std::span<char>(arr);
     auto s2 = asSpan<uint8_t>(sp2);
-    REQUIRE(s2.size() == 2);
-    CHECK(s2[0] == arr[0]);
-    CHECK(s2[1] == arr[1]);
+    EXPECT_THAT(s2, ElementsAreArray(arr));
 }
 
 } // namespace
