chromium/base/types/expected_unittest.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/types/expected.h"

#include <string>
#include <utility>
#include <vector>

#include "base/containers/contains.h"
#include "base/strings/to_string.h"
#include "base/test/gmock_expected_support.h"
#include "base/test/gtest_util.h"
#include "base/types/strong_alias.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {

namespace {

// Additional restrictions on implicit conversions. Not present in the C++23
// proposal.
static_assert;
static_assert;

template <typename T>
struct Strong {};

template <typename T>
struct Weak {};

template <typename T>
struct StrongMoveOnly {};

template <typename T>
struct WeakMoveOnly {};

enum class Error {};

enum class CvRef {};

struct SaveCvRef {};

TEST(Ok, ValueConstructor) {}

TEST(Ok, DefaultConstructor) {}

TEST(Ok, InPlaceConstructor) {}

TEST(Ok, InPlaceListConstructor) {}

TEST(Ok, ValueIsQualified) {}

TEST(Ok, MemberSwap) {}

TEST(Ok, EqualityOperators) {}

TEST(Ok, FreeSwap) {}

TEST(Unexpected, ValueConstructor) {}

TEST(Unexpected, DefaultConstructor) {}

TEST(Unexpected, InPlaceConstructor) {}

TEST(Unexpected, InPlaceListConstructor) {}

TEST(Unexpected, ErrorIsQualified) {}

TEST(Unexpected, MemberSwap) {}

TEST(Unexpected, EqualityOperators) {}

TEST(Unexpected, FreeSwap) {}

TEST(Expected, Triviality) {}

TEST(Expected, DefaultConstructor) {}

TEST(Expected, CopyConstructor) {}

TEST(Expected, MoveConstructor) {}

TEST(Expected, ExplicitConvertingCopyConstructor) {}

TEST(Expected, ImplicitConvertingCopyConstructor) {}

TEST(Expected, ExplicitConvertingMoveConstructor) {}

TEST(Expected, ImplicitConvertingMoveConstructor) {}

TEST(Expected, ExplicitValueConstructor) {}

TEST(Expected, ImplicitValueConstructor) {}

TEST(Expected, ExplicitOkConstructor) {}

TEST(Expected, ImplicitOkConstructor) {}

TEST(Expected, ExplicitErrorConstructor) {}

TEST(Expected, ImplicitErrorConstructor) {}

TEST(Expected, InPlaceConstructor) {}

TEST(Expected, InPlaceListConstructor) {}

TEST(Expected, UnexpectConstructor) {}

TEST(Expected, UnexpectListConstructor) {}

TEST(Expected, AssignValue) {}

TEST(Expected, CopyAssignOk) {}

TEST(Expected, MoveAssignOk) {}

TEST(Expected, CopyAssignUnexpected) {}

TEST(Expected, MoveAssignUnexpected) {}

TEST(Expected, Emplace) {}

TEST(Expected, EmplaceList) {}

TEST(Expected, MemberSwap) {}

TEST(Expected, FreeSwap) {}

TEST(Expected, OperatorArrow) {}

TEST(Expected, OperatorStar) {}

TEST(Expected, HasValue) {}

TEST(Expected, Value) {}

TEST(Expected, Error) {}

TEST(Expected, ToString) {}

TEST(Expected, ValueOr) {}

TEST(Expected, ErrorOr) {}

TEST(Expected, AndThen) {}

TEST(Expected, OrElse) {}

TEST(Expected, Transform) {}

TEST(Expected, TransformError) {}

TEST(Expected, EqualityOperators) {}

TEST(ExpectedDeathTest, UseAfterMove) {}

TEST(ExpectedVoid, Triviality) {}

TEST(ExpectedVoid, DefaultConstructor) {}

TEST(ExpectedVoid, InPlaceConstructor) {}

TEST(ExpectedVoid, CopyConstructor) {}

TEST(ExpectedVoid, MoveConstructor) {}

TEST(ExpectedVoid, ExplicitConvertingCopyConstructor) {}

TEST(ExpectedVoid, ImplicitConvertingCopyConstructor) {}

TEST(ExpectedVoid, ExplicitConvertingMoveConstructor) {}

TEST(ExpectedVoid, ImplicitConvertingMoveConstructor) {}

TEST(ExpectedVoid, OkConstructor) {}

TEST(ExpectedVoid, ExplicitErrorConstructor) {}

TEST(ExpectedVoid, ImplicitErrorConstructor) {}

TEST(ExpectedVoid, UnexpectConstructor) {}

TEST(ExpectedVoid, UnexpectListConstructor) {}

TEST(ExpectedVoid, CopyAssignUnexpected) {}

TEST(ExpectedVoid, MoveAssignUnexpected) {}

TEST(ExpectedVoid, Emplace) {}

TEST(ExpectedVoid, MemberSwap) {}

TEST(ExpectedVoid, FreeSwap) {}

TEST(ExpectedVoid, OperatorStar) {}

TEST(ExpectedVoid, HasValue) {}

TEST(ExpectedVoid, Value) {}

TEST(ExpectedVoid, Error) {}

TEST(ExpectedVoid, ToString) {}

TEST(ExpectedVoid, ErrorOr) {}

TEST(ExpectedVoid, AndThen) {}

TEST(ExpectedVoid, OrElse) {}

TEST(ExpectedVoid, Transform) {}

TEST(ExpectedVoid, TransformError) {}

TEST(ExpectedVoid, EqualityOperators) {}

TEST(ExpectedVoidTest, DeathTests) {}

}  // namespace

}  // namespace base