#include <catch2/catch_test_macros.hpp>
#include <fmt/core.h>
#include <string>
#include "shaders.hpp"

using namespace fmt;

TEST_CASE("shader loading/init works", "[shaders]") {
  shaders::init();
  int version = shaders::version();

  std::shared_ptr<sf::Shader> ui_shader = shaders::get("ui_shader");
  auto other_test = shaders::get("ui_shader");

  REQUIRE(ui_shader != nullptr);
  REQUIRE(ui_shader == other_test);
  REQUIRE(shaders::updated(version) == false);

  int new_version = shaders::reload();
  REQUIRE(version != shaders::version());
  REQUIRE(version != new_version);
  REQUIRE(shaders::version() == new_version);
  REQUIRE(shaders::updated(version) == true);
  version = new_version;

}
