/*
 * Copyright 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <ftl/match.h>
#include <gtest/gtest.h>

#include <chrono>
#include <string>
#include <variant>

namespace android::test {

// Keep in sync with example usage in header file.
TEST(Match, Example) {
  using namespace std::chrono;
  using namespace std::chrono_literals;
  using namespace std::string_literals;

  std::variant<seconds, minutes, hours> duration = 119min;

  // Mutable match.
  ftl::match(duration, [](auto& d) { ++d; });

  // Immutable match. Exhaustive due to minutes being convertible to seconds.
  EXPECT_EQ("2 hours"s,
            ftl::match(
                duration,
                [](const seconds& s) {
                  const auto h = duration_cast<hours>(s);
                  return std::to_string(h.count()) + " hours"s;
                },
                [](const hours& h) { return std::to_string(h.count() / 24) + " days"s; }));
}

}  // namespace android::test
