chromium/base/types/optional_util_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/optional_util.h"

#include <memory>
#include <optional>
#include <string>

#include "base/types/expected.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {
namespace {

TEST(OptionalUtilTest, OptionalToPtr) {}

TEST(OptionalUtilTest, OptionalFromPtr) {}

TEST(OptionalUtilTest, OptionalToExpected) {}

TEST(OptionalUtilTest, OptionalFromExpected) {}

// Basic test.
TEST(OptionalUtilTest, OptionalUnwrapTo_Basic) {}

// Test projection to a different type.
TEST(OptionalUtilTest, OptionalUnwrapTo_ProjectionLambda) {}

// Test projection through a non-lambda function.
TEST(OptionalUtilTest, OptionalUnwrapTo_ProjectionFunction) {}

// Test projection through a method.
TEST(OptionalUtilTest, OptionalUnwrapTo_ProjectionMethod) {}

// Verify const ref of optional<T> are passed as const T& to projection.
TEST(OptionalUtilTest, OptionalUnwrapTo_ConstRefOptional) {}

// Verify rvalue of optional<T> are passed as rvalue T to projection.
TEST(OptionalUtilTest, OptionalUnwrapTo_RvalueOptional) {}

// The output type is not the same, but it's assignable.
TEST(OptionalUtilTest, OptionalUnwrapTo_AssignableOutput) {}

}  // namespace
}  // namespace base