Fixed JsonVariant::operator|(int) to accept double (fixes #675)

This commit is contained in:
Benoit Blanchon
2018-02-09 09:05:29 +01:00
parent cf5396aaed
commit b4eece01f8
3 changed files with 28 additions and 3 deletions

View File

@ -51,6 +51,12 @@ TEST_CASE("JsonVariant::operator|()") {
REQUIRE(result == 0);
}
SECTION("double | int") {
JsonVariant variant = 42.0;
int result = variant | 666;
REQUIRE(result == 42);
}
SECTION("bool | bool") {
JsonVariant variant = false;
bool result = variant | true;