mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
I'm a tabs guy. I like tabs, it's an elegant way to represent indentation instead of brute-forcing it. But I have to admit that the world seems to be going towards spaces, and tooling tends not to play nice with tabs. So here we go, changing the whole repo to spaces since I'm getting tired of all the inconsistent formatting.
22 lines
555 B
C++
22 lines
555 B
C++
#include "kutil/constexpr_hash.h"
|
|
#include "catch.hpp"
|
|
|
|
using namespace kutil;
|
|
|
|
TEST_CASE( "constexpr hash", "[hash]" )
|
|
{
|
|
const unsigned hash1 = static_cast<unsigned>("hash1!"_h);
|
|
CHECK(hash1 == 210);
|
|
|
|
const unsigned hash2 = static_cast<unsigned>("hash1!"_h);
|
|
CHECK(hash1 == hash2);
|
|
|
|
const unsigned hash3 = static_cast<unsigned>("not hash1!"_h);
|
|
CHECK(hash1 != hash3);
|
|
CHECK(hash3 == 37);
|
|
|
|
const unsigned hash4 = static_cast<unsigned>("another thing that's longer"_h);
|
|
CHECK(hash1 != hash4);
|
|
CHECK(hash4 == 212);
|
|
}
|